How do I log the original message sent into a camel route?

Solution Verified - Updated -

Issue

How do I store the original message that came into the route in order to log it?

For example, I'd like to replace "I'M IN SLAVE MODE - DO NOTHING" with the actual message:

 <route>
        <from uri="direct:processOrders"/>
        <bean method="isMaster" ref="hasingleton"/>
        <choice>
            <when>
                <simple>${body} == true</simple>
                <to uri="file:c:/out/messages/?fileExist=Append&amp;fileName=messages.txt"/>
            </when>
            <otherwise>
                <log message="********* I'M IN SLAVE MODE - DO NOTHING"/>
            </otherwise>
        </choice>
    </route>

Environment

  • JBoss Fuse 6.X

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.