2
votes

I'm using deadLetterChannel to take care of exceptions and send them to the error queue.

errorHandler(deadLetterChannel(QUEUE_ERROR).maximumRedeliveries(3).redeliveryDelay(2000));
  1. Is it possible to enrich the message with additional message headers? Or do i have to use onException for it?
1

1 Answers

4
votes

You can use onRedelivery and with a processor to add headers before redelivering

errorHandler(deadLetterChannel(QUEUE_ERROR).maximumRedeliveries(3).redeliveryDelay(2000).onRedelivery(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
               //add headers here
            }
        }));