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.

Reply via email to