I got a problem to solve with Spring FeignClient.
I have two endpoints to send an SMS, both are the same behavior:
- When I send a GET with all query parameters required, the service sends the SMS.
- But I need to check if endpoint A is off – in which case I must send to endpoint B, both with the same request path and payload.
How can I solve this problem?
Today I have an interface with FeignClient annotation and just one URL.
I tried to make use a FeignBuilder to create the request in runtime and change the URL but without success.
How can I use Feign to control service fallback in client side, like:
@Value(${sms.urls})
List<String> endPoints;
for (endPoint : endPoints){
if(endPoint.isUp())
return makeRequest(endPoint).
}