In java, there are several ways to access variables, depending on the type of java class used:
onCall event class
public Object onCall(MuleEventContext eventContext, @Payload String payload) throws Exception { String returnPath = eventContext.getMessage().getProperty("myReturnPath", PropertyScope.OUTBOUND);
If passed MuleMessage:
public void process(@Payload MuleMessage payload ){ String returnPath = messge.getProperty("myReturnPath", PropertyScope.OUTBOUND);
Using OutboundHeader Annotation
public void process(@Payload String payload, @OutboundHeaders Map headers ){ String prop = headers.get("propname");
source share