camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: Howto use delay message brokerage in a Camel Route using AMQ_SCHEDULED_DELAY
Date Thu, 05 Jan 2012 21:43:47 GMT
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?

[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.dehandtschutter@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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message