Naveen Rayappa
Naveen Rayappa

Reputation: 119

Difference between session and outbound properties .

If all the outbound properties are converted to inbound properties on crossing the transport barrier , and all the outbound properties set are available at the mule endpoint as inbound properties , why do we need session variable ?

Upvotes: 1

Views: 1208

Answers (3)

Anirban Sen Chowdhary
Anirban Sen Chowdhary

Reputation: 8321

Session variables are used when you need the values within the application, as Session variables are Global throughout the application.
On the other hand, Outbound properties are used when you need the values outside the application into another application. Since outbound properties can cross across the transport barrier, we can easily get the value into other application, which the Session variable can't

Upvotes: 0

Vihar
Vihar

Reputation: 3831

You are right about the concept of outbound properties,but you need to consider following scenarios

  • The outbound properties(which can later become inbound properties) are visible only during execution of single flow i.e. they cannot be used across multiple flows.
  • when message is passed to a new flow via a flow-ref rather than a connector, the outbound properties remain outbound properties and are not converted to inbound property.

on the other hand for session variables

  • They are available across all flows within a application.

so there is a specific purpose for which mule has both outbound properties and session variables. You can use any one of those which cater to your specific requirements.

For further reference you can have a look here Mule Message

hope this helps!

Good luck!

Upvotes: 2

Adnama
Adnama

Reputation: 172

Here is a link, which helped my through when I was asking your question:

https://m-square.com.au/mule-school-the-mulemessage-property-scopes-and-variables/

I hope it helps.

Upvotes: 1

Related Questions