camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clay <clay.sebo...@emc.com>
Subject message.copy() Does not perform deep copy of the message body.
Date Mon, 19 Mar 2012 16:37:50 GMT
I am trying to copy a message so that I can alter it for subsequent
processing

    Message newMessage = message.copy();

but the MessageSupport.copyFrom() method (which is called from
MessageSupport.copy() )  does not copy the original message body to the
newMessage body, but only a reference to the original message body, which of
course then, causes any modification to the newMessage to modify the
original message.

This looks like a bug to me.  Can anyone confirm or deny this?  Or suggest a
workaround?

FYI- newMessage.copyFrom(message) does the same thing:

   Message newMessage = new DefaultMessage();
   newMessage.copyFrom(message);

Thanks




--
View this message in context: http://camel.465427.n5.nabble.com/message-copy-Does-not-perform-deep-copy-of-the-message-body-tp5577607p5577607.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message