This will be fixed in Camel 3.0 when we work on some internals in Camel.
On Wed, Sep 29, 2010 at 11:00 PM, Christian Mueller <[email protected]> wrote: > > Hello list, > > we are using camel-jms in conjunction with custom headers and the > useOriginalMessage() definition in our error handler for our exception > handling. We realized, that we loose all our headers in our dead letter > channel (using Camel 2.2.0.fuse-02-00). Our configuration looks like this > one: > > errorHandler( > deadLetterChannel("jms:queue:dead") > .useOriginalMessage()); > > from("jms:queue:foo") > .processRef("allwaysThrowExceptionProcessor") > .to("jms:queue:bar"); > > We digg this problem down to the DefaultUnitOfWork [1], which doesn't copy > the headers if the message is a JmsMessage. The documentation says: > //cannot copy headers with a JmsMessage as the underlying javax.jms.Message > object goes nuts > > Two line above, the java doc also says: > // TODO: the copy on facade strategy will help us here in the future > // TODO: optimize to only copy original message if enabled to do so in the > route > // special for JmsMessage as it can cause it to loose headers later. > // This will be resolved when we get the message facade with copy on write > implemented > > I have two questions: > 1) How we can prevent or work around this (copy the original message into a > custom header and do not use useOriginalMessage(). And restore the original > message in the error flow from this custom header)? > 2) When do you plan to fix this as the java doc suggests? > > > [1] > http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java?view=markup > > Cheers, > Christian > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Loosing-headers-by-using-errorHandler-and-useOriginalMessage-in-camel-jms-tp3046234p3046234.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
