Instead of tying your Java beans to the Mule API (with Callable
), you can do this using MEL only, for example with:
<invoke object-ref="yourBean"
method="yourMethod"
methodArguments="#[message.inboundProperties['inboundPropertyName']]" />
<set-property propertyName="outboundPropertyName"
value="#[payload]" />
This has the caveat that the message payload is affected by the invoke
element. If this is a problem then you can go with:
<expression-component>
propVal = app.registry.yourBean.yourMethod(message.inboundProperties['inboundPropertyName']);
message.outboundProperties['outboundPropertyName'] = propVal;
</expression-component>