Exactly how to fix org. springframework. cloud. netflix. feign. ribbon. feign load balancer read timeout
org. springframework. cloud. netflix. feign. bow. feign load balancer read timeout
The org. springframework. cloud. netflix. feign. ribbon. feign load balancer read timeout
house in spring-cloud-netflix
specifies the read timeout for this load balancer.
The standard value is 5000
.
org. springframework. foriegn. netflix. feign. bows. feign. loadbalancer. readTimeout=5000
Example
The following instance shows you just how to use the particular 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 will be used to place the amount associated with time (in milliseconds) that the load balancer will wait around for an answer through a server before time out. If the machine does not necessarily respond within this specified amount regarding time, the load balancer will mark the server seeing that not available and will not really attempt in order to connect to that once more until typically the next polling period.
This readTimeout
home is a worldwide real estate that does apply to all load balancers in typically the program. You may furthermore configure typically the readTimeout
home on a per-load-balancer basis by employing the RibbonClient
annotation. For example:
@RibbonClient(name ="my-service", settings = MyRibbonConfig. class) public program MyService // ...
Throughout the following illustration, the readTimeout
property is arranged to 10 just a few 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();