Is it possible to set RetryPolicy in spring retry based on error status code? e.g. I don't want to retry on HttpClientErrorException with HttpStatus.BAD_REQUEST status code, which is 400. Therefore it should ignore all other error codes -- 4XX.
I am using a Spring Integration http outboundGateway for invoking the server.
Right now in my RequestHandlerRetryAdvice I am configuring the my retry advice as
SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy(4, Collections.singletonMap(HttpClientErrorException.class, false));
But this is too generic, I just don't want to retry on 400 Status code. For every other scenarios i want my template to retried. Can someone suggest me a solution here?
I went through stack overflow questions and i found one relevant answer but i didn't serve my purpose. Is it possible to set RetryPolicy in spring-retry based on HttpStatus status code?