调整了kafka和feign
This commit is contained in:
@ -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
|
Reference in New Issue
Block a user