Is it possible to set RetryPolicy in spring-retry based on HttpStatus status code?
问题 Is it possible to set RetryPolicy in spring retry (https://github.com/spring-projects/spring-retry) based on error status code? e.g. I want to retry on HttpServerErrorException with HttpStatus.INTERNAL_SERVER_ERROR status code, which is 503. Therefore it should ignore all other error codes -- [500 - 502] and [504 - 511]. 回答1: The RestTemplate has setErrorHandler option and DefaultResponseErrorHandler is the default one. Its code looks like: public void handleError(ClientHttpResponse response)