Я перепробовал все способы, которые устанавливают тайм-аут для openfeign, но он не работает, код выглядит следующим образом:
@FeignClient(value = "EurekaClientProductComment",fallbackFactory = ProductCommentFallbackFactory.class,configuration = FeignConfiguration.class)
public interface ProductCommentFeign {
@GetMapping("/comments/product/{id}")
public List<Comment> getComments(@PathVariable("id") int id);
}
и FeignConfiguration.class
:
@Configuration
public class FeignConfiguration {
private Logger logger= LoggerFactory.getLogger(FeignConfiguration.class);
@Bean
public Request.Options requestOption(){
logger.info("config request option finished");
return new Request.Options(70000,70000);
}
@Bean
public Retryer configRetryer(){
logger.info("config retryer checked");
return new Retryer.Default(2000, 4000, 3);
}
}
global config:
feign.hystrix.enabled=true
feign.httpclient.enabled=true
feign.okhttp.enabled=false
feign.client.config.default.connect-timeout=10000
feign.client.config.default.read-timeout=10000
#feign.client.config.default.retryer=feign.
ribbon.okhttp.enabled=false
ribbon.eager-load.enabled=true
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=10000
hystrix.command.default.execution.timeout.enable=false
#ribbon.ConnectTimeout=10000
##ribbon.ReadTimeout=60000
#feign.client.config.default.retryer=feign.Retryer.Default
#feign.client.config.default.connectTimeout=160000000
#feign.client.config.default.readTimeout=160000000