I have a Java component that receives a payload (JsonData), like this:
public String myMethod(JsonData payload) throws IOException {
// do things with payload.
}
This is working fine, but I also need to access a flow variable within the method. I understand that, to do so, I need to run myMessage.getInvocationProperty("my-variable-name"); However, since I'm only passing the payload, I don't have access to the MuleMessage. How can I change my method so I can get access to my message/property?
I tried:
org.mule.RequestContext.getEvent().getMessage()
but it is deprecated.
Also, I've read all sorts of answers on this issue but never found a complete answer.
Thanks,