Just how to fix org. springframework. cloud. netflix. feign. ribbon. feign load balancer read timeout

org.springframework.cloud.netflix.feign.ribbon.feign load balancer read timeout
org.springframework.cloud.netflix.feign.ribbon.feign load balancer read timeout

org. springframework. fog up. netflix. feign. bow. feign load balancer read timeout

The org. springframework. cloud. netflix. feign. ribbon. feign load balancer read timeout real estate in spring-cloud-netflix specifies the read timeout for typically the load balancer.

The predetermined value is 5000 .

 org. springframework. impair. netflix. feign. ribbon. feign. loadbalancer. readTimeout=5000 

Example

The following illustration shows you how to use this org. springframework. cloud. netflix. feign. ribbon. feign load balancer read timeout property:

 @SpringBootApplication open public class Application public static void main(String[] args) SpringApplication.run(Application.class, args); @Bean public Client feignClient() return Feign.builder() .target(Client.class, "http://localhost:8080") .options(new Options(5000, 60000)) .build(); 

Additional Information

The readTimeout property is definitely used to set in place the amount involving time (in milliseconds) that the load balancer will hang on for a reaction by a storage space before time out. If typically the server does not necessarily respond within the specified amount regarding time, the load balancer will mark the server while inaccessible and will not really attempt to be able to hook up to this again until the particular next polling span.

The particular readTimeout house is a global house that is applicable to all load balancers in the technique. You can easily also configure this readTimeout property on a per-load-balancer basis by using the RibbonClient avis. For instance:

 @RibbonClient(name ="my-service", construction = MyRibbonConfig. class) public interface MyService // ... 

Within the following example of this, the readTimeout property is fixed to 10 seconds for the my-service load balancer:

 @Configuration public course MyRibbonConfig @Bean public Client feignClient() return Feign.builder() .target(Client.class, "http://localhost:8080") .options(new Options(10000, 60000)) .build();