Otherwise (just an idea) you can try and use the onRedelivery mechanism of Camel's DeadLetterErrorHandler. This allows you to plug-in your own processor. Inside this processor you can use the Exchange.REDELIVERY_COUNTER and Exchange.REDELIVERY_MAX_COUNTER properties to figure out when it's time to set your own header.
On Sun, Dec 29, 2013 at 12:21 PM, Richard Kettelerij < [email protected]> wrote: > Hi, > > If I'm not mistaken you should already be able to get the exception from > the exchange using the Exchange.EXCEPTION_CAUGHT property. Assuming you're > using Camel's DeadLetterErrorHandler like this: > > > errorHandler(deadLetterChannel("jms:queue:dead").maximumRedeliveries(3).redeliveryDelay(5000)); > > You should be able to just call > exchange.getProperty(Exchange.EXCEPTION_CAUGHT) on the exchanges in the > "dead" queue and get the exception. > > Regards, > Richard > > > On Sun, Dec 29, 2013 at 9:19 AM, rhuiser <[email protected]> wrote: > >> Hi all, >> >> When a message ends-up on the designated DLQ when the max redelivery count >> has reached, is it possible to add a custom header to this message? >> >> What I would like is to have a header with the reason (exception) why the >> messages could not be processed. This simplifies troubleshooting >> tremendously. >> >> Any ideas? >> >> Robin >> >> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/Add-custom-header-when-message-is-rolled-back-to-queue-in-transaction-tp5745311.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> > >
