调整了kafka和feign
This commit is contained in:
@ -20,5 +20,9 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-okhttp</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -1,10 +1,27 @@
|
||||
package com.chinaunicom.mall.ebtp.cloud.feign.starter;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.okhttp.OkHttpClient;
|
||||
|
||||
@Configuration
|
||||
@PropertySource("classpath:feign-configuration.properties")
|
||||
public class FeignStarterConfiguration {
|
||||
|
||||
@Bean
|
||||
public OkHttpClient client() {
|
||||
return new OkHttpClient();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RequestInterceptor requestInterceptor() {
|
||||
return requestTemplate -> {
|
||||
requestTemplate.header("user", "mall");
|
||||
requestTemplate.header("password", "mall");
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
# 默认开启熔断
|
||||
feign.hystrix.enabled=true
|
@ -16,9 +16,17 @@
|
||||
<name>mall-ebtp-cloud-kafka-starter</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.kafka</groupId>
|
||||
<artifactId>spring-kafka</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
Reference in New Issue
Block a user