On Wed, Dec 12, 2012 at 7:01 PM, dunnlow <dunn...@yahoo.com> wrote: > Willem, thank you for your response - although I'm sorry, I don't fully > understand it. > > I have a transacted route that pulls a msg from activemq and sends it to > another route that multicasts that message to a variety of services. If any > of those services throw an exception I want to leave the msg on the queue > and try again for 5 times. After that I want to reroute the message to a > file. > > In the case above, does the org.apache.activemq.RedeliveryPolicy I have set > up (shown below) on my connection factory to activemq see that as a retry or > is that totally independent? (I thought this would be considered one retry) > > <bean id="jmsRedeliverPolicy" class="org.apache.activemq.RedeliveryPolicy"> > <property name="maximumRedeliveries" value="5"/> > <property name="initialRedeliveryDelay" value="1000"/> > <property name="maximumRedeliveryDelay" value="256000"/> > <property name="useExponentialBackoff" value="true"/> > <property name="backOffMuliplier" value="2"/> > </bean> > > In other words, could the camel redelivery policy roll back the transaction > 20 times and the above redelivery policy not kick in? >
If you use transacted acknowledgement and using the AMQ broker's redelivery policy. Then you let the broker handle all the redelivery, and moving to its DLQ when all redelivery attempts fails. Then you should not let Camel do any error handling, as you rely on the AMQ broker doing it. Though AMQ can only move the exhausted message to its DLQ (which is a message queue) and not save to a file. What you can do is to have a Camel route that reads from the DLQ and routes to a file. Another alternative would be to let Camel read the "JMSRedeliveryCounter" I think there is such a counter. And if its > max, then you can use a Camel filter / content based router etc to route the message to a file. And mind Camel's redelivery / error handling is happening at where the "problem" is. And not "all over again". Where as AMQ will redeliver the message to the route again (= "all over again".). And Camel's is pure in memory based. > Thanks > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Using-Dead-letter-channel-with-ActiveMQ-tp5723865p5723962.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