配置文件
@Configuration
public class FeignConfiguration {
@Value("${service.feign.connectTimeout:60000}")
private int connectTimeout;
@Value("${service.feign.readTimeOut:60000}")
private int readTimeout;
@Bean
public Request.Options options() {
return new Request.Options(connectTimeout, readTimeout);
}
}
然后feignclient添加这个配置文件
@FeignClient(value = "SERVER-NAME",configuration = FeignConfiguration.class)
网友评论