If this is possible for you, I think the simplest way is to fix Camel 2.6.0 by your own. Checkout the tagged version and apply this simple fix [1].
Otherwise you can ask the commercial vendors for a fixed version. [1] https://fisheye6.atlassian.com/viewrep/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java?r1=1239497&r2=1294893 Best, Christian On Mon, Apr 30, 2012 at 2:35 PM, Bernard Ligny <bernard.li...@gmail.com>wrote: > Thanks a lot for the fix info, Christian > Unfortunately, i am stuck to v2.6.0 (and cannot upgrade) :-( > > Therefore, I am trying to implement a simple workaround, and wrote the > following (pretty basic) interceptor: > > /** > * This processor augments the default 'UnitOfWork' for a Camel exchange of > JMS type, > * so that getOriginalMessage() does not clone only the body but also the > header > * making thereby possible to replay messages from a DeadLetterQueue. > */ > public class JmsExchangePatcher implements Processor { > > @Override > public void process(Exchange exchange) throws Exception { > if ( > > exchange.getIn().getClass().getSimpleName().equals(JmsMessage.class.getName()) > && > > > exchange.getUnitOfWork().getClass().getName().equals(DefaultUnitOfWork.class.getName()) > ) { > exchange.setUnitOfWork( new > CustomUnitOfWork(exchange) ); > } > } > > private static final class CustomUnitOfWork extends > DefaultUnitOfWork { > protected ForemUnitOfWork(Exchange exchange) { > super(exchange); > getOriginalInMessage().setHeaders( > exchange.getIn().getHeaders() ); > } > } > > } > > > But apparently it is not sufficient. > The Camel headers are now well present in original msg, but seem to be > scratched when the exchange is converted to a JMS Message (when put in the > DLQ) > > Can you give me some additional hint about what (else) needs to be done for > a complete workaround. > > Thanks in advance > > Bernard. > > NB: Feel free to move this post to the "User" list... > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/OriginalMsg-Why-is-only-the-body-cloned-for-JMS-messages-tp5675413p5675851.html > Sent from the Camel Development mailing list archive at Nabble.com. >