How to combine 2 values ​​in a mule?

Can someone please let me know how to concatenate multiple values ​​in a mule?

Sort of,

#[payload.getPayload()].concat(#[getSubject()]) 
+4
source share
3 answers

I assume that you are using Mule 3.3.x or higher. If so, you can use the Mule expression language (MEL).

One example of using MEL:

 #['Hello' + 'World'] 

Or MEL also allows you to use a standard Java method call:

 #[message.payload.concat(' Another String')] 

Crib on MEL

+7
source

Another alternative is to use the Mule Design plugin:

Cancel the Add Row operation as many times as you need.

This operation takes the message payload of the previous step and concatenates the specified string. Not sure about the details of performance, but it will certainly be easier to maintain.

Add to String - MuleSoft

0
source

you can declare a string buffer using the expression component

 <expression-component doc:name="Expression"><![CDATA[StringBuffer sb = new StringBuffer(); flowVars.stBuffer=sb; ]]></expression-component> 

and then add using append in the string buffer somewhere in the stream.

flowVars.stBuffer.append ("string to append")

After using #[flowVars.stBuffer] to access the concatenated string

0
source

All Articles