I have written a custom Anypoint connector (using devkit), and want it to set Inbound properties, much like the Mule HTTP connector does. MuleMessage
however, does not seem to have facility to do this.
How does one mimic this behavior?
Asked
Active
Viewed 2,635 times
1

Gilbert
- 3,584
- 2
- 26
- 30
2 Answers
1
Inbound properties are immutable, It can be achieved via the MuleMessage https://www.mulesoft.org/docs/site/3.3.0/apidocs/org/mule/api/MuleMessage.html#setProperty(java.lang.String, java.lang.Object, org.mule.api.transport.PropertyScope)
However, unless your connector operation is a Message Source I wouldn't add inbound properties and instead use outbound properties.

Ryan Carter
- 11,441
- 2
- 20
- 27
0
You need to use
MuleMessage message = eventContext.getMessage();
message.setProperty("key","value",PropertyScope.INBOUND);
You can refer the API :-https://www.mulesoft.org/docs/site/3.3.0/apidocs/org/mule/api/MuleMessage.html#setProperty
https://www.mulesoft.org/docs/site/3.3.0/apidocs/org/mule/api/transport/PropertyScope.html

scorpion
- 223
- 3
- 15