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. cloud. netflix. feign. ribbon. feign load balancer read timeout

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

The arrears value is 5000 .

 org. springframework. cloud. netflix. feign. bows. feign. loadbalancer. readTimeout=5000 

Example

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

 @SpringBootApplication general 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 used to set in place the amount of time (in milliseconds) that the load balancer will hold out for an answer through a hardware before time out. If the particular machine does not act in response within typically the specified amount involving time, the load balancer will tag the server seeing that not available and will certainly not attempt for you to hook up to the idea yet again until this next polling span.

Typically the readTimeout real estate is a world-wide property that does apply to all load balancers in this program. You can in addition configure this readTimeout home on a per-load-balancer basis by applying the RibbonClient rflexion. For example:

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

Throughout the following illustration, the readTimeout property is set to 10 seconds for the my-service load balancer:

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