You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Asankha C. Perera" <as...@wso2.com> on 2006/05/11 11:50:30 UTC
Co-relating synchronous response messages for mediation..
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: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org
Re: Co-relating synchronous response messages for mediation..
Posted by Saminda Abeyruwan <sa...@gmail.com>.
Cool idea, +1
Saminda
On 5/11/06, Deepal jayasinghe <de...@gmail.com> 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: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
>
>
> --
> Thanks,
> Deepal
> ................................................................
> ~Future is Open~
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>
Re: Co-relating synchronous response messages for mediation..
Posted by Deepal jayasinghe <de...@gmail.com>.
+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: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>
--
Thanks,
Deepal
................................................................
~Future is Open~
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org
Re: Co-relating synchronous response messages for mediation..
Posted by Paul Fremantle <pz...@gmail.com>.
+1 Chinthaka
We need to be able to handle both where WS-A is engaged (and obeyed by the
endpoint) and not.
I would like some way of marking context that needs to be copied into the
response context. So there shouldn't be just a single context item that is
copied, but any number that are needed.
Paul
On 5/11/06, Eran Chinthaka <ch...@opensource.lk> wrote:
>
> Hi Asankha,
>
> When a request comes if you know which scenario, then you can use
> reference parameters for this transaction, as an alternative to saving a
> state in your context.
>
> Assuming addressing is engaged, you can send out ref params in the
> ReplyTo epr and get them back to you.
>
> - Chinthaka
>
> 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: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
>
>
>
>
>
--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
http://bloglines.com/blog/paulfremantle
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
Re: Co-relating synchronous response messages for mediation..
Posted by Eran Chinthaka <ch...@opensource.lk>.
Hi Asankha,
When a request comes if you know which scenario, then you can use
reference parameters for this transaction, as an alternative to saving a
state in your context.
Assuming addressing is engaged, you can send out ref params in the
ReplyTo epr and get them back to you.
- Chinthaka
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: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>