Hi Devs,
Problem : Synapse needs a way to keep
track of status of the incoming message.
Use case: Assume a message comes
(IN-Path) to Synapse and it is subjected to few rules such as route to the
destination1, once the response returns to Synapse (if), again the message
process through Synapse and hit another rule to say route the message
destination2. Once the response return (hopfully) we need to send THIS
processed response message again to to the initiator of the original message
(the Client).
Now during the above process we "new"
SynaspeMessages and MessageContext in Synapse, thus, this will restrain the
ability of keeping the state of THIS message.
As there is no such mechanism involved, there
is no way Synapse to know whether to trigger transport level details of
Axis2 such as choosing between 200 OK and 202 OK.
Proposal
At present there is only ONE
SynapseEnvironment available for every message that is coming into Synapse.
(This is analogues to Axis2's ConfigurationContext)
According to the architecture <send/>
will create a new SynapseMessage when the response comes to a outbound
message. So it it obvious that <send/> is the last "Mediator" that
should be in the mediator chain, before newing another SynapseMessage to
inject the response back into Synapse. This is equivalent of treating this
message as a fresh message entering into Synapse. yet, this is the response
to the original me
So, what we need per IN-Message is another
level of abstraction that does not change with newing SynapseMessage. Let's
Call this MediationContext.
So when a message enters into Synapse there is
only one MediationContext exist for all of this message mutations until the
return comes back to SynapseMessageReceiver, to select between 200/202 OK.
So this MediatonContext can be used to keep
state across mediators for a given message.
Please see Figure1.
Please be kind enough to express your
consensus on prior.
Thank you
Saminda
---------------------------------------------------------------------
To
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]