0
votes

I've noticed that if I have a flow pattern such as this:

<flow name="httpIn">
    <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:9001/test/in" />
    <logger level="INFO" />
    <http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:9001/test/out" />
    <logger level="INFO" />
</flow>

that the inbound properties from the original HTTP request get lost after the outbound-endpoint with request-response exchange pattern is called.

Is this normal behavior? Is there a way to disable this overall for all outbound-endpoints, or is this endpoint specific?

3

3 Answers

2
votes

Yes, that is the normal behavior. It's quite well explained here:

http://blogs.mulesoft.org/mule-school-the-mulemessage-property-scopes-and-variables/

Mule Inbound Properties

Inbound properties can’t be set by you. Message sources (such as inbound endpoints) set them for you when they receive a message. Inbound properties are lost when crossing a “transport barrier” Mule Outbound Properties

Outbound properties can be set by you. When crossing a “transport barrier”, outbound properties are automatically turned into inbound properties, and no longer exist as outbound properties. - See more at: http://blogs.mulesoft.org/mule-school-the-mulemessage-property-scopes-and-variables/#sthash.yGzTrZEQ.dpuf

1
votes

Yes, Mule inbound properties doesn't propagate amid transports. As explained in this link

  • Inbound properties are automatically generated by the message source and cannot be set or manipulated by the user.
  • Outbound properties can be configured by the user. Outbound properties are set during the course of a flow and can become inbound properties when the message passes from the outbound endpoint of one flow to the inbound endpoint of a different flow via a transport. (Note that if the message is passed to a new flow via a flow-ref rather than a transport, the outbound properties will remain outbound properties rather than being converted to inbound properties.)

Note, however, you can retain all inbound properties in between transports by copying properties like this:

<copy-properties propertyName="*" />

This will copy all properties, you may also specify specific property name if you just want few.

0
votes

Mule Inbound Properties :These properties are set by the message source or inblound endpoint automatically.they can’t be set by you. They are immutable ie. you cannot make any changes to them. You can only access them but you ccannot modify them. They are lost after crossing a “transport barrier”

Mule Outbound Properties:These properties can be set by you. After crossing a transport barrierl ike http, outbound properties are automatically transformed into inbound properties, and they are be no longer found in outbound scope.