FAQ
Is it possible to nest a transform so that it does not alter the original
message payload?

This alters original payload:

<camelContext xmlns="http://camel.apache.org/schema/spring">
   <route>
     <from uri="direct:start"/>
     <transform>
       <simple>${in.body} extra data!</simple>
     </transform>
     <to uri="mock:end"/>
   </route>
</camelContext>

In psuedo-code, I want to isolate the message transform from downstream
endpoints:

<camelContext xmlns="http://camel.apache.org/schema/spring">
   <route>
     <from uri="direct:start"/>
     <isolate>
         <transform>
           <simple>${in.body} extra data!</simple>
           <to uri="mock:end"/>
         </transform>
     </isolate>
-- original body without "extra data!"
     <to uri="mock:end"/>
   </route>
</camelContext>



--
View this message in context: http://camel.465427.n5.nabble.com/Transform-without-modifying-message-for-downstream-endpoints-tp5747057.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Mark Frazier at Feb 11, 2014 at 1:31 am
    Use the recipient list EIP and transform only on one branch.
    On Feb 10, 2014, at 5:27 PM, MichaelAtSAG wrote:

    Is it possible to nest a transform so that it does not alter the original
    message payload?

    This alters original payload:

    <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
    <from uri="direct:start"/>
    <transform>
    <simple>${in.body} extra data!</simple>
    </transform>
    <to uri="mock:end"/>
    </route>
    </camelContext>

    In psuedo-code, I want to isolate the message transform from downstream
    endpoints:

    <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
    <from uri="direct:start"/>
    <isolate>
    <transform>
    <simple>${in.body} extra data!</simple>
    <to uri="mock:end"/>
    </transform>
    </isolate>
    -- original body without "extra data!"
    <to uri="mock:end"/>
    </route>
    </camelContext>



    --
    View this message in context: http://camel.465427.n5.nabble.com/Transform-without-modifying-message-for-downstream-endpoints-tp5747057.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • MichaelAtSAG at Mar 26, 2014 at 12:16 am
    Thanks Mark. I reviewed the recipient list pattern in Camel documentation
    <http://camel.apache.org/recipient-list.html> and do not see how this
    solves the transform issue. Could you be so kind as to provide a code
    example?


    Upon further reading, I was thinking that a multicast pattern may best suite
    this use case, like:

    <camelContext xmlns="http://camel.apache.org/schema/spring">
         <route>
             <from uri="direct:start"/>
             <multicast>
                 <to uri="direct:a"/>
                 <to uri="direct:b"/>
             </multicast>
         </route>

         <route>
             <from uri="direct:a"/>
             <transform>
                     <simple>${in.body} extra data!</simple>
             </transform>
             <to uri="mock:a"/>
         </route>
         <route>
             <from uri="direct:b"/>
    -- original body without "extra data!"
             <to uri="mock:b"/>
         </route>
    </camelContext>


    Thoughts?



    --
    View this message in context: http://camel.465427.n5.nabble.com/Transform-without-modifying-message-for-downstream-endpoints-tp5747057p5749365.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedFeb 11, '14 at 1:28a
activeMar 26, '14 at 12:16a
posts3
users2
websitecamel.apache.org

2 users in discussion

MichaelAtSAG: 2 posts Mark Frazier: 1 post

People

Translate

site design / logo © 2022 Grokbase