Flow Variable V/S Session Variable With Mule ESB


A Variable is used to set or remove a variable on message. The Scope Variable is limited to the flow where it is set. When a message leaves the flow, the variable doesn’t carry to next flow or application.

Flow Variable

The Flow Variable is used to set or remove the variable tied to message in current flow. Variables set by flow variable transformer persist for the current flow and cannot cross the transport barrier.
The Flow Variable can be accessed in current flow, calling flows (sub flow/private flow) and even their child flows.
The Flow Variable can be accessed using syntax #[flowVars.Id] if the Id is the name of flow variable.

Flow Variable [Video]

Session Variable

The Session Variable is used to set or remove the variable tied to current message for its entire lifecycle across multiple flows and even servers.
Variables set by the Session Variable transformer persist for the entire lifecycle regardless of transport barrier. The Session Variable can be accessed in current flow, calling/child, flow within the entire project, and even JVM systems.
Session Variable can be accessed using syntax #[sessionVars.Id] if the Id is the name of the Session Variable.

Session Variable [Video]

Add a Comment

Your email address will not be published. Required fields are marked *