camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From efender <eric+nab...@fender.net>
Subject Saving original destination when sending to DLQ
Date Tue, 09 Dec 2008 13:07:41 GMT

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.


Mime
View raw message