FeginConfig.java
822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.bs.common.config.fegin;
import com.bs.common.interceptor.FeignRequestInterceptor;
import feign.Logger;
import feign.RequestInterceptor;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author danmo
* @description fegin配置
* @date 2021/5/31 11:18
**/
@Configuration
public class FeginConfig {
@Bean
public Logger.Level feignLoggerLevel() {
return Logger.Level.BASIC;
}
@Bean
Logger feignLogger() {
return new FeginLogger(); // 你的继承类
}
@Bean
public Retryer.Default retryerDefault(){
return new Retryer.Default();
}
@Bean
public RequestInterceptor requestInterceptor()
{
return new FeignRequestInterceptor();
}
}