Camel Users,

I'm using Camel 2.9.0.  I have the following route:

        <route id="test">
                <from uri="jms:queue:queue.test" />
                <to uri="jms:queue:queue.someQueue"/>
                <process ref="testProcess"/>
                <to uri="jms:queue:queue.someOtherQueue"/>
        </route>

Where testProcess always throws an exception. For testing purposes!

My goal is to achieve the following: (i) if <process> fails, the enqueue to
'queue.someQueue' should always be rolled-back; (ii)  if <process> fails,
Camel should retry the route a configurable maximum number of times; (iii)
If the route fails the maximum number of times, the initial message dequeued
from 'queue.test' should be enqueued onto a dead-letter queue so that the
next message on 'queue.test' can be processed.

My understanding is that this should be a 'transacted' route, and that I
should use a TransactedErrorHandler.  I have read the documentation here:
http://camel.apache.org/transactionerrorhandler.html

But I'm afraid I cannot understand this rather intimidating sentence: "When
the ValidationException is thrown from the validate order bean it is
intercepted by the TransactionErrorHandler and it let the
onException(ValidationException.class handle it so the Exchange is routed to
this route and since we use handled(true) then the original exception is
lowered (= cleared) and we transform the message into a fixed response that
are returned to jetty endpoint that returns it to the original caller."

If anyone could offer an explanation, help or advice, or point out an
example that acheives something similar to my desired behaviour, I would be
very appreciative. 

We are using ActiveMQ as our JMS implementation, but would rather keep this
JMS implementation non-specific.

Thanks.








--
View this message in context: 
http://camel.465427.n5.nabble.com/TransactedErrorHandler-requeue-JMS-message-to-DLQ-tp5716945.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to