1
votes

I have a MuleClient that sends a message to a Mule flow like below but I dont see properties reflected in the mule flow in response section, what scope should I make the properties to be?

MuleMessage msg = new DefaultMuleMessage();
Map<String,Object> propertiesMap = new HashMap<String,Object>();
propertiesMap.put("name", "hello");
msg.addProperties( propertiesMap, PropertyScope.INVOCATION);

then in the flow I tried to access this property like this

message.getInvocationProperty("name")

and it returns null... What am i missing?

2
How do you send to the flow? It is not shown above.David Dossot
i have tried this two ways... code client.send( "vm://myPath", msg);code I have also tried this code client.send("vm://myPath", payload, propertiesMap );mdev

2 Answers

4
votes

If you send a message to a flow using a VM (or any transport) endpoint, invocation properties will not be propagated.

You need to place the properties in the outbound scope: they will arrive in the inbound scope out of the inbound endpoint of the flow.

0
votes

Since you are sending the MuleMessage to Connector (ie. inbound vm ), Invocation properties not available in your flow. MessageProperties in outbound scope wil be modified into inbound scope. so use the outbound scope, in your flow access like #[message.inboundPrperties['name']]