Precisely 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 property in spring-cloud-netflix specifies the read timeout for this load balancer.

The default value is 5000 .

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

Example

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

 @SpringBootApplication community 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 collection the amount regarding time (in milliseconds) that the load balancer will wait around for a reply from a machine before moment out. If the particular hardware does not necessarily act in response within this specified amount associated with time, the load balancer will mark the server seeing that inaccessible and will not necessarily attempt to connect to that yet again until this next polling period.

The particular readTimeout home is a worldwide property that does apply to all load balancers in the particular method. You can furthermore configure the particular readTimeout real estate on a per-load-balancer basis by using the RibbonClient rflexion. For instance:

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

Inside the following example, the readTimeout property is arranged to 10 secs for the my-service load balancer:

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