|
@@ -1,14 +1,20 @@
|
|
|
package com.sf.config.feign;
|
|
|
|
|
|
-import feign.Logger;
|
|
|
-import feign.Request;
|
|
|
-import feign.Retryer;
|
|
|
+import feign.*;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
+import java.net.http.HttpClient;
|
|
|
+
|
|
|
@Configuration
|
|
|
public class FeignConfig {
|
|
|
|
|
|
+// @Bean
|
|
|
+// public Contract useFeignAnnotations() {
|
|
|
+// return new Contract.Default();
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
// 另一种配置日志级别的方式
|
|
|
@Bean
|
|
|
public Logger.Level feignLoggerLevel() {
|
|
@@ -24,8 +30,8 @@ public class FeignConfig {
|
|
|
@Bean
|
|
|
public Retryer retryer() {
|
|
|
// 请求失败后是否重试 默认是不重试
|
|
|
-// return Retryer.NEVER_RETRY;
|
|
|
+ return Retryer.NEVER_RETRY;
|
|
|
// 最大请求次数为3次 初始间隔时间为100ms 重试最大间隔时间为1s
|
|
|
- return new Retryer.Default(100,1,3);
|
|
|
+// return new Retryer.Default(100,1,3);
|
|
|
}
|
|
|
}
|