Hi I'm using the spring RestTemplate
for calling a REST API. The API can be very slow or even offline. My application is building the cache by sending thousands of requests one after the other. The responses can be very slow too, because they contains a lot of data.
I have already increased the Timeout to 120 seconds. My problem now it that the API can be offline and I get a org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
exception.
In the case when the API ist offline, the application should wait and try again until the API is online again.
Can I achieve this in RestTemplate
out of the box without building exception-loops on my own?
Thanks!