title: Tuning RetryPolicy in spring-retry based on HttpStatus status code?
body: <p>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.</p>
  
  <p>I am using a Spring Integration http outboundGateway for invoking the server.</p>
  
  <p>Right now in my RequestHandlerRetryAdvice I am configuring the my retry advice as </p>
  
  <pre><code>SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy(4, Collections.singletonMap(HttpClientErrorException.class, false));
  </code></pre>
  
  <p>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?</p>
  
  <p>I went through stack overflow questions and i found one relevant answer but i didn't serve my purpose. <a href="https://stackoverflow.com/questions/27236216/is-it-possible-to-set-retrypolicy-in-spring-retry-based-on-httpstatus-status-cod">Is it possible to set RetryPolicy in spring-retry based on HttpStatus status code?</a> </p>