Using sping’s restTemplate with a timeout, how do I detect a timeout?

In case of RestTemplate, when the request gets timed out, Spring will throw ResourceAccessException. Underlying exception under that instance will be java.net.SocketTimeoutException with message ‘Read timed out’.

Leave a Comment

tech