camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StevenD <steven.dehandtschut...@gmail.com>
Subject Re: Howto use delay message brokerage in a Camel Route using AMQ_SCHEDULED_DELAY
Date Mon, 02 Jan 2012 12:06:06 GMT
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.

Mime
View raw message