Garmaine Staff asked 2 years ago

I am working on a project where I have to call a third party REST service. The problem with the current setup is that service does not return in at least 16 seconds. This response time may exceed more than that.

To avoid the threads waiting on the server, my service has a timeout value of 16 seconds. But that value is not helping. I searched on this and found that Circuit breaker pattern will be useful. Reference:- Spring Boot REST API – request timeout? . I believe this pattern is useful when the service has slow response few of the times. In my case it is always a slow service. How can I tackle this scenario?