How to concatenate 2 values in mule?

Learner picture Learner · Feb 25, 2013 · Viewed 23.3k times · Source

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

Something like,

#[payload.getPayload()].concat(#[getSubject()])

Answer

Ryan Carter picture Ryan Carter · Feb 25, 2013

I assume you are using Mule 3.3.x or above. If so you can use Mule Expression Language(MEL).

One example using MEL is:

#['Hello' + 'World']

Or MEL also allows you to use standard Java method invocation:

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

Cheat sheet on MEL

MULE 4 Update

For Mule 4. Dataweave 2.0 is the main expression language:

Simple concat:

#['Hello' ++ ' World']