How can I record the original destination when routing to my DLQ?

I've tried a custom processor which does this:

public void process(Exchange exchange) throws Exception {
        org.apache.camel.Message in = exchange.getIn();
        org.apache.camel.Message out = in.copy();
        out.setHeader("originalDestination", in.getHeader("JMSDestination"));
        exchange.setProperty("originalDestination",
in.getHeader("JMSDestination"));
        exchange.setOut(out);
}

But neither the property nor the header is set in my bean which listens to
the DLQ.  Do I need to modify/subclass
org.apache.camel.processor.DeadLetterChannel to get this behavior?

Also, I'd like to save the original Exception that caused the message to get
routed to the DLQ as well.  I see that it is stored in
org.apache.camel.processor.DeadLetterChannel.FAILURE_HANDLED and
CamelCauseException, but those properties disappear by the time the message
gets to the DLQ.

Any recommendations on how to save this info in a best practice sort of way?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Saving-original-destination-when-sending-to-DLQ-tp20914367s22882p20914367.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to