Maybe your InternalMessage is not full copied.
Can you just create a new copy of internalMessage in the modify method and set it to the message body after the modification ?

BTW, you can change the wireTap uri to a log endpoint, it could be easy track the message.

Willem

On 10/12/10 7:36 PM, Muhammad Ichsan wrote:
Dear Camel Experts

I have an object which becomes the main message to be transported
across camel routes. So, I don't use String or other simple object.
That's why I have to use converter.

@Converter
public class InternalMessageConverter {

        @Converter
        public static InputStream toText(InternalMessage iMsg) {
                return new ByteArrayInputStream(iMsg.toString().getBytes());
        }
}

The problem is at this route:

<route>
        ....
        <wireTap uri="activemq:log.transaction" /><!-- Log the iMessage -->

        <choice>
                <when>
                        <simple>${in.header.nextDestination} != null</simple>
                        <wireTap uri="direct:invokeInBackground" />
                </when>
        </choice>
</route>


<route>
        <from uri="direct:invokeInBackground" />
        
        <to uri="bean:modifier?method=modify" />
        
        <!-- Send to create reversal TX log -->
        <wireTap uri="activemq:log.transaction" /><!-- Log the modified iMessage 
-->
</route>


When I send a message, the log.transaction will have the same messages
which are both modified. I expect that I will have two different
messages inside log.transaction (the unmodified and the modified one).
Because the first wireTap sends the unmodified message to log but the
second one sends the modified message. How to achieve this?

Thanks



--
Willem
----------------------------------
Open Source Integration: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: http://twitter.com/willemjiang

Reply via email to