You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Laurent CHARTIER <ex...@agora.msa.fr> on 2007/11/20 11:44:50 UTC

Clone mediator

Hi all,
in the sequence I'm writing, when I receive a message, I have to create
another message to request a specific WS before I can send the received
message to the endpoint.
Is there a way that the cloned messages created by the clone mediator are
not processed parallelly ?
 
Thanks,
Laurent CHARTIER
ME Socles Techniques - Pôle Mise en Œuvre
AGORA Montauban - Tél. :05.63.68.48.11
P Avant d'imprimer, pensez à l'Environnement
 



Ce message est protégé par les règles relatives au secret des correspondances. Il est donc établi à destination exclusive de son destinataire. Celui-ci peut donc contenir des informations confidentielles. La divulgation de ces informations est à ce titre rigoureusement interdite. Si vous avez reçu ce message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure ci-dessus et de détruire le message ainsi que toute pièce jointe.

This message is protected by the secrecy of correspondence rules. Therefore, this message is intended solely for the attention of the addressee. This message may contain privileged or confidential information, as such the disclosure of these informations is strictly forbidden. If, by mistake, you have received this message, please return this message to the addressser whose e-mail address is written above and destroy this message and all files attached.



Re: Clone mediator

Posted by Ruwan Linton <ru...@gmail.com>.
Hi Laurent,

Well, first I must say that there is no option to specify clone mediator to
process the cloned message as blocking. At the same time, even if there is
an option it will not fit in with your requirement because the the transport
of synapse is non-blocking and hence after sending the message that thread
will return without waiting for the response.

I think Asankha is writing a blocking call-out mediator, which exactly fits
your requirement. Asankha???

Thanks,
Ruwan .

On Nov 20, 2007 4:14 PM, Laurent CHARTIER <ex...@agora.msa.fr>
wrote:

> Hi all,
> in the sequence I'm writing, when I receive a message, I have to create
> another message to request a specific WS before I can send the received
> message to the endpoint.
> Is there a way that the cloned messages created by the clone mediator are
> not processed parallelly ?
>
> Thanks,
> Laurent CHARTIER
> ME Socles Techniques - Pôle Mise en Œuvre
> AGORA Montauban - Tél. :05.63.68.48.11
> P Avant d'imprimer, pensez à l'Environnement
>
>
>
>
> Ce message est protégé par les règles relatives au secret des
> correspondances. Il est donc établi à destination exclusive de son
> destinataire. Celui-ci peut donc contenir des informations confidentielles.
> La divulgation de ces informations est à ce titre rigoureusement interdite.
> Si vous avez reçu ce message par erreur, merci de le renvoyer à l'expéditeur
> dont l'adresse e-mail figure ci-dessus et de détruire le message ainsi que
> toute pièce jointe.
>
> This message is protected by the secrecy of correspondence rules.
> Therefore, this message is intended solely for the attention of the
> addressee. This message may contain privileged or confidential information,
> as such the disclosure of these informations is strictly forbidden. If, by
> mistake, you have received this message, please return this message to the
> addressser whose e-mail address is written above and destroy this message
> and all files attached.
>
>
>


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Re: Clone mediator

Posted by Ruwan Linton <ru...@gmail.com>.
Yes Alexander,

This is what exactly call-out does, AFAIK.

Thanks,
Ruwan

On Nov 20, 2007 4:54 PM, Alexander Faust <ba...@gmail.com> wrote:

> Hi,
>
> you could maybe NOT clone the message with the clone mediator and
> just create a mediator that will copy the MessageContext, request the
> other WS, wait for an answer, send the answer to the endpoint and
> then continue processing the original MessageContext like nothing
> happened?
> This way the processing of the original Message would be delayed
> until you could process the copy.
>
> Hope this helps... sorry for the bad english.
>
> Alexander Faust
>
> Am 20.11.2007 um 11:44 schrieb Laurent CHARTIER:
>
> > Hi all,
> > in the sequence I'm writing, when I receive a message, I have to
> > create
> > another message to request a specific WS before I can send the
> > received
> > message to the endpoint.
> > Is there a way that the cloned messages created by the clone
> > mediator are
> > not processed parallelly ?
> >
> > Thanks,
> > Laurent CHARTIER
> > ME Socles Techniques - Pôle Mise en Œuvre
> > AGORA Montauban - Tél. :05.63.68.48.11
> > P Avant d'imprimer, pensez à l'Environnement
> >
> >
> >
> >
> > Ce message est protégé par les règles relatives au secret des
> > correspondances. Il est donc établi à destination exclusive de son
> > destinataire. Celui-ci peut donc contenir des informations
> > confidentielles. La divulgation de ces informations est à ce titre
> > rigoureusement interdite. Si vous avez reçu ce message par erreur,
> > merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure ci-
> > dessus et de détruire le message ainsi que toute pièce jointe.
> >
> > This message is protected by the secrecy of correspondence rules.
> > Therefore, this message is intended solely for the attention of the
> > addressee. This message may contain privileged or confidential
> > information, as such the disclosure of these informations is
> > strictly forbidden. If, by mistake, you have received this message,
> > please return this message to the addressser whose e-mail address
> > is written above and destroy this message and all files attached.
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-user-help@ws.apache.org
>
>


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Re: Clone mediator

Posted by "Asankha C. Perera" <as...@wso2.com>.
I committed a simple Callout mediator last night to the Synapse trunk.
For those of you who may want to check it out, I have uploaded a
SNAPSHOT build here
http://people.apache.org/~asankha/builds/synapse/SNAPSHOT/

The Syntax is as follows:
 <callout serviceURL="string" [action="string"]>
      <source xpath="expression" | key="string">
      <target xpath="expression" | key="string"/>
 </callout>

Basically the callout mediator would make a blocking call to the
provided service using the URL and the optional action. This request
message could be a fragment from the current message if the source
attribute specifies an XPath expression to get the necessary payload
(Note: only the payload which will go within the SOAP body should be
specified here). Alternatively you could refer to some XML fragment you
have previously stored into the current message context via a property
key, or even a local or remote registry entry that holds an XML request
payload. If a target XPath expression is specified, that node from the
current message is replaced with the reply received after the callout.
If a key is specified, the response is stored on the current message
context as an XML fragment.

Note that I also made a slight enhancement to the XSLT mediator to be
able to store the result of a transformation (i.e. the XML fragment) as
a message context property. i.e. the "target" attribute as shown below.

<xslt key="property-key" [source="xpath"] [target="string"]>
   <property name="string" (value="literal" | expression="xpath")/>
</transform>

Your thoughts and suggestions are welcome. However, note that this
offers only the ability to make simple callouts and thus would have
limitations!

asankha

Asankha C. Perera wrote:
> Hi Guys
>
> This is your lucky day! I would be committing a simple Callout mediator
> to the Synapse trunk later today.. and this would allow you to do this
> rather easily.. I will try to make a nightly build and upload along with
> it..
>
> thanks
> asankha
>
> Alexander Faust wrote:
>   
>> Hi,
>>
>> you could maybe NOT clone the message with the clone mediator and just
>> create a mediator that will copy the MessageContext, request the other
>> WS, wait for an answer, send the answer to the endpoint and then
>> continue processing the original MessageContext like nothing happened?
>> This way the processing of the original Message would be delayed until
>> you could process the copy.
>>
>> Hope this helps... sorry for the bad english.
>>
>> Alexander Faust
>>
>> Am 20.11.2007 um 11:44 schrieb Laurent CHARTIER:
>>
>>     
>>> Hi all,
>>> in the sequence I'm writing, when I receive a message, I have to create
>>> another message to request a specific WS before I can send the received
>>> message to the endpoint.
>>> Is there a way that the cloned messages created by the clone mediator
>>> are
>>> not processed parallelly ?
>>>
>>> Thanks,
>>> Laurent CHARTIER
>>> ME Socles Techniques - Pôle Mise en Œuvre
>>> AGORA Montauban - Tél. :05.63.68.48.11
>>> P Avant d'imprimer, pensez à l'Environnement
>>>
>>>
>>>
>>>
>>> Ce message est protégé par les règles relatives au secret des
>>> correspondances. Il est donc établi à destination exclusive de son
>>> destinataire. Celui-ci peut donc contenir des informations
>>> confidentielles. La divulgation de ces informations est à ce titre
>>> rigoureusement interdite. Si vous avez reçu ce message par erreur,
>>> merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure
>>> ci-dessus et de détruire le message ainsi que toute pièce jointe.
>>>
>>> This message is protected by the secrecy of correspondence rules.
>>> Therefore, this message is intended solely for the attention of the
>>> addressee. This message may contain privileged or confidential
>>> information, as such the disclosure of these informations is strictly
>>> forbidden. If, by mistake, you have received this message, please
>>> return this message to the addressser whose e-mail address is written
>>> above and destroy this message and all files attached.
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: synapse-user-help@ws.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-user-help@ws.apache.org
>
>
>   

Re: Clone mediator

Posted by "Asankha C. Perera" <as...@wso2.com>.
I committed a simple Callout mediator last night to the Synapse trunk.
For those of you who may want to check it out, I have uploaded a
SNAPSHOT build here
http://people.apache.org/~asankha/builds/synapse/SNAPSHOT/

The Syntax is as follows:
 <callout serviceURL="string" [action="string"]>
      <source xpath="expression" | key="string">
      <target xpath="expression" | key="string"/>
 </callout>

Basically the callout mediator would make a blocking call to the
provided service using the URL and the optional action. This request
message could be a fragment from the current message if the source
attribute specifies an XPath expression to get the necessary payload
(Note: only the payload which will go within the SOAP body should be
specified here). Alternatively you could refer to some XML fragment you
have previously stored into the current message context via a property
key, or even a local or remote registry entry that holds an XML request
payload. If a target XPath expression is specified, that node from the
current message is replaced with the reply received after the callout.
If a key is specified, the response is stored on the current message
context as an XML fragment.

Note that I also made a slight enhancement to the XSLT mediator to be
able to store the result of a transformation (i.e. the XML fragment) as
a message context property. i.e. the "target" attribute as shown below.

<xslt key="property-key" [source="xpath"] [target="string"]>
   <property name="string" (value="literal" | expression="xpath")/>
</transform>

Your thoughts and suggestions are welcome. However, note that this
offers only the ability to make simple callouts and thus would have
limitations!

asankha

Asankha C. Perera wrote:
> Hi Guys
>
> This is your lucky day! I would be committing a simple Callout mediator
> to the Synapse trunk later today.. and this would allow you to do this
> rather easily.. I will try to make a nightly build and upload along with
> it..
>
> thanks
> asankha
>
> Alexander Faust wrote:
>   
>> Hi,
>>
>> you could maybe NOT clone the message with the clone mediator and just
>> create a mediator that will copy the MessageContext, request the other
>> WS, wait for an answer, send the answer to the endpoint and then
>> continue processing the original MessageContext like nothing happened?
>> This way the processing of the original Message would be delayed until
>> you could process the copy.
>>
>> Hope this helps... sorry for the bad english.
>>
>> Alexander Faust
>>
>> Am 20.11.2007 um 11:44 schrieb Laurent CHARTIER:
>>
>>     
>>> Hi all,
>>> in the sequence I'm writing, when I receive a message, I have to create
>>> another message to request a specific WS before I can send the received
>>> message to the endpoint.
>>> Is there a way that the cloned messages created by the clone mediator
>>> are
>>> not processed parallelly ?
>>>
>>> Thanks,
>>> Laurent CHARTIER
>>> ME Socles Techniques - Pôle Mise en Œuvre
>>> AGORA Montauban - Tél. :05.63.68.48.11
>>> P Avant d'imprimer, pensez à l'Environnement
>>>
>>>
>>>
>>>
>>> Ce message est protégé par les règles relatives au secret des
>>> correspondances. Il est donc établi à destination exclusive de son
>>> destinataire. Celui-ci peut donc contenir des informations
>>> confidentielles. La divulgation de ces informations est à ce titre
>>> rigoureusement interdite. Si vous avez reçu ce message par erreur,
>>> merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure
>>> ci-dessus et de détruire le message ainsi que toute pièce jointe.
>>>
>>> This message is protected by the secrecy of correspondence rules.
>>> Therefore, this message is intended solely for the attention of the
>>> addressee. This message may contain privileged or confidential
>>> information, as such the disclosure of these informations is strictly
>>> forbidden. If, by mistake, you have received this message, please
>>> return this message to the addressser whose e-mail address is written
>>> above and destroy this message and all files attached.
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: synapse-user-help@ws.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-user-help@ws.apache.org
>
>
>   

Re: Clone mediator

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Guys

This is your lucky day! I would be committing a simple Callout mediator
to the Synapse trunk later today.. and this would allow you to do this
rather easily.. I will try to make a nightly build and upload along with
it..

thanks
asankha

Alexander Faust wrote:
> Hi,
>
> you could maybe NOT clone the message with the clone mediator and just
> create a mediator that will copy the MessageContext, request the other
> WS, wait for an answer, send the answer to the endpoint and then
> continue processing the original MessageContext like nothing happened?
> This way the processing of the original Message would be delayed until
> you could process the copy.
>
> Hope this helps... sorry for the bad english.
>
> Alexander Faust
>
> Am 20.11.2007 um 11:44 schrieb Laurent CHARTIER:
>
>> Hi all,
>> in the sequence I'm writing, when I receive a message, I have to create
>> another message to request a specific WS before I can send the received
>> message to the endpoint.
>> Is there a way that the cloned messages created by the clone mediator
>> are
>> not processed parallelly ?
>>
>> Thanks,
>> Laurent CHARTIER
>> ME Socles Techniques - Pôle Mise en Œuvre
>> AGORA Montauban - Tél. :05.63.68.48.11
>> P Avant d'imprimer, pensez à l'Environnement
>>
>>
>>
>>
>> Ce message est protégé par les règles relatives au secret des
>> correspondances. Il est donc établi à destination exclusive de son
>> destinataire. Celui-ci peut donc contenir des informations
>> confidentielles. La divulgation de ces informations est à ce titre
>> rigoureusement interdite. Si vous avez reçu ce message par erreur,
>> merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure
>> ci-dessus et de détruire le message ainsi que toute pièce jointe.
>>
>> This message is protected by the secrecy of correspondence rules.
>> Therefore, this message is intended solely for the attention of the
>> addressee. This message may contain privileged or confidential
>> information, as such the disclosure of these informations is strictly
>> forbidden. If, by mistake, you have received this message, please
>> return this message to the addressser whose e-mail address is written
>> above and destroy this message and all files attached.
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-user-help@ws.apache.org


Re: Clone mediator

Posted by Alexander Faust <ba...@gmail.com>.
Hi,

you could maybe NOT clone the message with the clone mediator and  
just create a mediator that will copy the MessageContext, request the  
other WS, wait for an answer, send the answer to the endpoint and  
then continue processing the original MessageContext like nothing  
happened?
This way the processing of the original Message would be delayed  
until you could process the copy.

Hope this helps... sorry for the bad english.

Alexander Faust

Am 20.11.2007 um 11:44 schrieb Laurent CHARTIER:

> Hi all,
> in the sequence I'm writing, when I receive a message, I have to  
> create
> another message to request a specific WS before I can send the  
> received
> message to the endpoint.
> Is there a way that the cloned messages created by the clone  
> mediator are
> not processed parallelly ?
>
> Thanks,
> Laurent CHARTIER
> ME Socles Techniques - Pôle Mise en Œuvre
> AGORA Montauban - Tél. :05.63.68.48.11
> P Avant d'imprimer, pensez à l'Environnement
>
>
>
>
> Ce message est protégé par les règles relatives au secret des  
> correspondances. Il est donc établi à destination exclusive de son  
> destinataire. Celui-ci peut donc contenir des informations  
> confidentielles. La divulgation de ces informations est à ce titre  
> rigoureusement interdite. Si vous avez reçu ce message par erreur,  
> merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure ci- 
> dessus et de détruire le message ainsi que toute pièce jointe.
>
> This message is protected by the secrecy of correspondence rules.  
> Therefore, this message is intended solely for the attention of the  
> addressee. This message may contain privileged or confidential  
> information, as such the disclosure of these informations is  
> strictly forbidden. If, by mistake, you have received this message,  
> please return this message to the addressser whose e-mail address  
> is written above and destroy this message and all files attached.
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-user-help@ws.apache.org