I saw one weak point in my own proposal.. since we may have *changed* the "To" field (or any such field for that matter..) of the original request before we sent it out.. the Send mediator will still not be able to set a distinguishing property on the response. (i.e. case #1 and #2 both would have the same To field)

So how about this.. we use existing constructs and a special MessageContext property as follows:

<set-property name="correlate" value="<what you want to use>"/>

This special MessageContext property "correlate" would be copied from the request messages' MessageContext into the response messages' MessageContext by the send mediator. Then you would be able to perform a synapse:get-property('correlate') on the response mediation chain to perform the necessary processing. You would also be able to still set the "To", "WSAAction" or any custom value for correlation in this manner...

asankha

Deepal jayasinghe wrote:
+1.

Asankha C. Perera wrote:

  
I was writing some sample Synapse configurations to illustrate the new
configuration language and came across this requirement...

Scenario 1: The StockQuote client sends a stock quote request to
synapse, and synapse routes this to the actual service, receives the
response and sends this back to the client

Scenario 2: A custom stock quote client sends a custom stock quote
request, which synapse "transforms" into a standard stock quote and
sends to the actual service. Now once the response is received, the
client expects this to be "transformed" back again as a custom
response and returned.

However right now synapse cannot handle case #2 for synchronous
responses, as it might be required to support both scenarios at the
same time, and it has no way to differentiate between the responses in
the two cases.

I was thinking of saving the original To address (of the request) as a
property into the MessageContext of the response, so that this could
be used to mediate the response as necessary? We may be able to use
the new XPath extension function we introduced as follows:

<filter source="synapse:get-property('request/To')"
regex=".*/StockQuote.*">
   .....
</filter>

Do you think this is a good idea?

asankha


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


    


  
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to