I am using feign client in my spring boot application and I want to configure separate timeouts for different calls for example if I have update and create calls and I want to set read time out for update = 3000 and for create =12000, how can I do that?
@FeignClient(name = "product-service")
public interface ProductClient {
@PostMapping(value = "/product/create")
public ProductCreation productCreationExternalRequest(@RequestBody ProductCreationRequest productCreationRequest);
@PostMapping(value = "/product/update")
public ProductCreation productUpdateExternalRequest(@RequestBody ProductCreationRequest productCreationRequest );
}
My service class is :
public class MyService {
.
.
productCreationResponse = productClient.productCreationExternalRequest(productCreationRequest);
..
productupdateResponse = productClient.productUpdateExternalRequest(productCreationRequest);
}
You can do it by sending options parameter as argument of you feign methods:
And then use your methods like next: