Reputation: 2226
I have following service:
@FeignClient(name = "person", fallback = FeignHystrixFallback.class)
public interface PersonService {
@RequestMapping(value = "/find", method = RequestMethod.GET)
Person findPerson(@RequestParam("name") String name);
}
How to change the default timeout and thread pool size?
Upvotes: 0
Views: 3391
Reputation: 881
Set custom configuration for this interface
@FeignClient(name="person", configuration = FeignConfig.class)
and make configuration
public class FeignConfig {
public static final int FIVE_SECONDS = 5000;
@Bean
public Request.Options options() {
return new Request.Options(FIVE_SECONDS, FIVE_SECONDS);
}
}
Upvotes: 0
Reputation: 3440
There are other people that have run into this issue and have posted questions and have answers. The most relevant is this post:
Feign builder timeouts not working
If you are wanting to manage the configuration of Feign you would want to check out the Feign documentation looking at the "configuration" attribute of the @FeignClient annotation.
Upvotes: 1