On Thu, Jan 5, 2012 at 10:43 PM, Christian Müller <christian.muel...@gmail.com> wrote: > Steven, Gert, did you could have a look at [1]. > > I would like to work/support work on a specialized ActiveMQ error handler > which could like below (or similar): > > errorHandler( > activeMqDeadLetterChannel(activemq:queue:dlq) > .useOriginalMessage() > .maximumRedeliveries(8) > .deliveryDelay(60000) > .useExponentialBackOff() > .backOffMultiplier(2)); > > It should use the ActiveMQ scheduled delay option to not have the messages > in flight when we have to wait for a new retry. What do you think? >
ActiveMQ already have redelivery baked in. And from 5.6 onwards it support async non-blocked scheduled redelivery. https://issues.apache.org/jira/browse/AMQ-1853 > [1] > camel.465427.n5.nabble.com/Missing-feature-to-handle-errors-in-a-route-which-reads-from-an-activemq-destination-td4416986.html > > Best, > Christian > > On Mon, Jan 2, 2012 at 1:06 PM, StevenD > <steven.dehandtschut...@gmail.com>wrote: > >> Thanks, this was really helpful. I noticed however that the delay only >> worked >> for the first retry, all subsequent retries would be handled immediately. I >> solved this by resetting the scheduledJobId back to null just before >> sending >> it back to the queue. My exception handler now looks like: >> >> ... >> .onException(Exception.class) >> .handled(true) >> .beanRef("dispatchRetryTagger") >> .choice() >> .when(header("dispatchRetryCount").isLessThan(3)) >> .setHeader("AMQ_SCHEDULED_DELAY", constant("4000")) >> .setHeader("scheduledJobId", constant(null)) >> .to("activemq:queue:myqueue") >> .otherwise() >> .removeHeader("AMQ_SCHEDULED_DELAY") >> .to("direct:dlq") >> .end() >> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/Howto-use-delay-message-brokerage-in-a-Camel-Route-using-AMQ-SCHEDULED-DELAY-tp4282763p5114568.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/