What is the difference between Shared context, Correlation context, and Transient context? When to use which?
Definition |
When to use? | |
---|---|---|
Shared context |
Thread-based memory location shared across all instances of the SMO running within the same thread for the request or response flow. |
Used typically in a fan-out/fan-in aggregation to temporarily store service responses. |
Correlation context |
Used when Mediation primitives want to pass values from the request flow to the response flow. |
Used to pass values from the request message onto the response. |
Transient context |
Used for passing values between Mediation primitives within the current flow—either the request flow or the response flow. The transient context cannot link requests and responses and hence cannot be used across. |
Used when you want to save an input message before a service invokes call (within a request or response flow). After the service invoke call, the next primitive can create another message by combining the service invoke response and the original message stored in the transient context. |