On Wed, Feb 13, 2013 at 6:45 PM, dunnlow <dunn...@yahoo.com> wrote:
> I have a solution that seems to be working.  I have assigned a context
> errorHandler and have a deliverypolicy that has a dead letter uri (a route
> that dumps to a file), like:
>
>     <camelContext.... errorhandlerRef="errorHandler"/>
>
>     <errorHandler id="errorHandler" type="DeadLetterChannel"
> deadLetterUri="direct:dumpToFile" useOriginalMessage="true">
>         <redeliveryPolicy maximumRedeliveries="5"....... />
>     </errorHandler>
>
>     <route>
>        <from:jms:testQueue>
>        <transacted>
>        <bean:ref="myBean" method="sendToWebService"/>
>     </route>
>
>
> When a message fails 5 times (to test I am shutting down the web service, so
> there is a connection exception thrown), it is routed to my "dumpToFile"
> route.
>
> I'm still using the Spring JmsTransactionManager in my JMS config for the
> connection factory because if I don't and camel shuts down during the
> retries, the message is lost (pulled off the queue).
>
> A few questions:
>
> 1) My ActiveMQ redeliveryPolicy seems to be getting ignored.  I believe that
> the camel error handler is intercepting so that spring/activemq does not see
> the rollback.  Does this seem correct?
>

Yes the Camel error handler kick-in first. And only the AMQ afterwards.
But because you use a DeadLetterChannel in Camel, then Camel will
remove any traces of error/exception.
So the AMQ seems the message as "commit" and not "rollback".



> 2) Does anyone see any issues with this approach?
>
> Claus, meant to mention, I never found a JMSRedeliveryCounter.
>
> Thanks again,
> -J
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Using-Dead-letter-channel-with-ActiveMQ-tp5723865p5727544.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to