Reputation: 3034
I have a problem where one mule component transform the payload object into some other value. Ex: Suppose my payload contain student object. Initial value of Student name=a;
My first mule component change student name to x;
Student s=new Student();
s.setName("x");
My second mule component receive name as X
from payload. But I want original value as 'a'
.
I tried checking original payload of mule but that value is also changed..
<flow .....
<component> </component> // 1st component
<component></component> //2nd component
</flow>
I want same payload(original) (Student object with name a) in both the component..how can I do that? I have checked original payload and that has been transformed..
Thanks
Upvotes: 1
Views: 2450
Reputation: 8321
Mule also use scatter gather
component, which sends the payload to multiple endpoints in parallel. This component has been introduced from Mule 3.5.0 ..
example :
<scatter-gather doc:name="Scatter-Gather" timeout="6000">
<flow-ref name="flightBroker1" />
<flow-ref name="flightBroker2" />
<flow-ref name="flightBroker3" />
</scatter-gather>
Here is the reference :- https://developer.mulesoft.com/docs/display/current/Scatter-Gather
Upvotes: 3
Reputation: 4551
You can use <all>
to send same payload to different components like
<flow .....
<all>
<component> </component> // 1st component
<component></component> //2nd component
</all>
</flow>
or, a different way to approach same thing is to store the original payload in a variable and then replace the payload with the previous one like:
<set-variable variableName="originalPayload" value="#[message.payload]" />
and then,
<set-payload value="#[flowVars.originalPayload]"/>
Upvotes: 4