title: How to take different actions based on HTTP response code, with Apache Camel
body: <p>I'm using Apache Camel's (2.15.x) HTTP4 component and hitting an external web service. Sometimes the responses are <code>200</code>, sometimes they are <code>422</code>, and sometimes they are <code>500</code>. For the <code>200</code>s, I'm good. My problem is that I want to retry when I get the <code>500</code> but not when I get the <code>422</code>. In both cases, it's an <code>HttpOperationFailedException</code>. I've looked at the Camel documentation and Googled but I've not found any examples of how to do this. Any advice, or URLs, would be greatly appreciated.</p>
  
  <p>Thanks.</p>