title: Apache Camel - problem with error handling
body: <p>I have a problem with error handling. If an exception occurs in the <code>jrnRoute</code>, it is processed by the <code>exceptionHandler</code> processor. This is OK. But the message which caused the exception still stays in the <code>jrnQueue</code>, is processed again and causes the error over and over again. Also I have a warning (see below) in logs. How to stop the infinite redelivery? I want to throw a message away in case of an error.</p>
  
  <p><code>Camel configuration</code>
      
      
          
          
          </p>
  
  <pre><code>    &lt;camel:onException&gt;
          &lt;camel:exception&gt;java.lang.Exception&lt;/camel:exception&gt;
          &lt;camel:redeliveryPolicy disableRedelivery="true" /&gt;
          &lt;camel:process ref="exceptionHandler" /&gt;
          &lt;camel:rollback markRollbackOnly="true" /&gt;
      &lt;/camel:onException&gt;
  
      &lt;camel:route id="translatorRoute"&gt;
          &lt;camel:from ref="transactionsQueue" /&gt;
          &lt;camel:process ref="messageTranslator" /&gt;
          &lt;camel:inOnly ref="apfRequestQueue" /&gt;
      &lt;/camel:route&gt;
      &lt;camel:route id="jrnRoute"&gt;
          &lt;camel:from ref="jrnQueue" /&gt;
          &lt;camel:process ref="jrnProcessor" /&gt;
          &lt;camel:stop /&gt;
      &lt;/camel:route&gt;
  &lt;/camel:camelContext&gt;
  </code></pre>
  
  <p><code>Warning</code></p>
  
  <pre><code>11:15:00,141 WARN  [JmsMessageListenerContainer] Execution of JMS message listener failed, and no ErrorHandler has been set.
  org.apache.camel.RuntimeCamelException: org.apache.camel.RollbackExchangeException: Intended rollback. Exchange[JmsMessage: [ObjectMessageImpl com.swiftmq.jms.ObjectMessageImpl@c84d9d
  messageIndex = 5_2
  messageId = [LazyUTF8String, s=ID:/172.26.214.11/5349789614428334512/10/0, buffer=[B@5f7fd8]
  userId = [LazyUTF8String, s=null, buffer=[B@1c254aa]
  clientId = null
  timeStamp = 1316682898526
  correlationId = null
  replyTo = null
  destination = jrnQueue@z4smq_4001
  deliveryMode = 2
  redelivered = true
  deliveryCount = 8
  type = null
  expiration = 0
  priority = 4
  props = {...}
  readOnly = true
  sourceRouter = null
  destRouter = null
  destQueue = null array=[B@1447e6b cnt=1295]]
      at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1145)
      at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:108)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
  Caused by: org.apache.camel.RollbackExchangeException: Intended rollback. Exchange[JmsMessage: [ObjectMessageImpl com.swiftmq.jms.ObjectMessageImpl@c84d9d
  messageIndex = 5_2
  messageId = [LazyUTF8String, s=ID:/172.26.214.11/5349789614428334512/10/0, buffer=[B@5f7fd8]
  userId = [LazyUTF8String, s=null, buffer=[B@1c254aa]
  clientId = null
  timeStamp = 1316682898526
  correlationId = null
  replyTo = null
  destination = jrnQueue@z4smq_4001
  deliveryMode = 2
  redelivered = true
  deliveryCount = 8
  type = null
  expiration = 0
  priority = 4
  props = {...}
  readOnly = true
  sourceRouter = null
  destRouter = null
  destQueue = null array=[B@1447e6b cnt=1295]]
  </code></pre>