You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Andrea_P <an...@fastwebnet.it> on 2008/10/15 13:58:15 UTC

Extending Synapse - Write a new mediator

Hi everyone!!
I've encountered a problem when I've tried to write a custom mediator.
My mediator should implement a new version of the standard send mediator;
when the send, to the current endpoint, fails the mediator should find
itself a new endpoint to which send the same message. The new endpoint
should have similar characteristics of the original endpoint.
But I don't find, in the source code on the official site, some methods to
understand if the endpoint is active or not. 
Moreover I've tryed some methods to modify the SOAP message addressed to
Synapse (i.e. I want to add the tag "To"), but nothing seems to work.
Thanks,
Andrea.
-- 
View this message in context: http://www.nabble.com/Extending-Synapse---Write-a-new-mediator-tp19992050p19992050.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.


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


Re: Extending Synapse - Write a new mediator

Posted by "Asankha C. Perera" <as...@wso2.com>.
Andrea
> There is difference between my mediator and the failover ednpoint... In fact,
> in case of fail, the failover endpoint works with endpoints that use the
> same parameters, my mediator should work with similar but not equal
> endpoints.
> e.g.:With failover endpoint all services must accept integer parameters,
> with my mediator a service can work with integers, another with floats and
> so on... 
>   
Do you mean that you want to transform the failed message and then send 
to the failover/retry endpoint? If so, you could use an error handler 
sequence from the sequence that attempts the first send. If an error 
occurs, your error handler will be called, and within that sequence you 
can do almost anything else again..

asankha

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


Re: Extending Synapse - Write a new mediator

Posted by Paul Fremantle <pz...@gmail.com>.
Interesting. I see. One way you could do this is using the exception
handling to catch the failure and then transform the request.

Paul

On Wed, Oct 15, 2008 at 3:04 PM, Andrea_P <an...@fastwebnet.it> wrote:
>
> There is difference between my mediator and the failover ednpoint... In fact,
> in case of fail, the failover endpoint works with endpoints that use the
> same parameters, my mediator should work with similar but not equal
> endpoints.
> e.g.:With failover endpoint all services must accept integer parameters,
> with my mediator a service can work with integers, another with floats and
> so on...
>
> pzfreo wrote:
>>
>> Andrea
>>
>> I think the function you are writing is already there. Its called a
>> failover endpoint.
>>
>> Please see this code:
>> http://synapse.apache.org/apidocs/org/apache/synapse/endpoints/FailoverEndpoint.html
>> https://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/FailoverEndpoint.java
>>
>> Paul
>>
>>
>> On Wed, Oct 15, 2008 at 12:58 PM, Andrea_P <an...@fastwebnet.it>
>> wrote:
>>>
>>> Hi everyone!!
>>> I've encountered a problem when I've tried to write a custom mediator.
>>> My mediator should implement a new version of the standard send mediator;
>>> when the send, to the current endpoint, fails the mediator should find
>>> itself a new endpoint to which send the same message. The new endpoint
>>> should have similar characteristics of the original endpoint.
>>> But I don't find, in the source code on the official site, some methods
>>> to
>>> understand if the endpoint is active or not.
>>> Moreover I've tryed some methods to modify the SOAP message addressed to
>>> Synapse (i.e. I want to add the tag "To"), but nothing seems to work.
>>> Thanks,
>>> Andrea.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Extending-Synapse---Write-a-new-mediator-tp19992050p19992050.html
>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Paul Fremantle
>> Co-Founder and CTO, WSO2
>> Apache Synapse PMC Chair
>> OASIS WS-RX TC Co-chair
>>
>> blog: http://pzf.fremantle.org
>> paul@wso2.com
>>
>> "Oxygenating the Web Service Platform", www.wso2.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Extending-Synapse---Write-a-new-mediator-tp19992050p19994203.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>



-- 
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: Extending Synapse - Write a new mediator

Posted by Andrea_P <an...@fastwebnet.it>.
There is difference between my mediator and the failover ednpoint... In fact,
in case of fail, the failover endpoint works with endpoints that use the
same parameters, my mediator should work with similar but not equal
endpoints.
e.g.:With failover endpoint all services must accept integer parameters,
with my mediator a service can work with integers, another with floats and
so on... 

pzfreo wrote:
> 
> Andrea
> 
> I think the function you are writing is already there. Its called a
> failover endpoint.
> 
> Please see this code:
> http://synapse.apache.org/apidocs/org/apache/synapse/endpoints/FailoverEndpoint.html
> https://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/FailoverEndpoint.java
> 
> Paul
> 
> 
> On Wed, Oct 15, 2008 at 12:58 PM, Andrea_P <an...@fastwebnet.it>
> wrote:
>>
>> Hi everyone!!
>> I've encountered a problem when I've tried to write a custom mediator.
>> My mediator should implement a new version of the standard send mediator;
>> when the send, to the current endpoint, fails the mediator should find
>> itself a new endpoint to which send the same message. The new endpoint
>> should have similar characteristics of the original endpoint.
>> But I don't find, in the source code on the official site, some methods
>> to
>> understand if the endpoint is active or not.
>> Moreover I've tryed some methods to modify the SOAP message addressed to
>> Synapse (i.e. I want to add the tag "To"), but nothing seems to work.
>> Thanks,
>> Andrea.
>> --
>> View this message in context:
>> http://www.nabble.com/Extending-Synapse---Write-a-new-mediator-tp19992050p19992050.html
>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
> 
> 
> 
> -- 
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
> 
> blog: http://pzf.fremantle.org
> paul@wso2.com
> 
> "Oxygenating the Web Service Platform", www.wso2.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Extending-Synapse---Write-a-new-mediator-tp19992050p19994203.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.


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


Re: Extending Synapse - Write a new mediator

Posted by Paul Fremantle <pz...@gmail.com>.
Andrea

I think the function you are writing is already there. Its called a
failover endpoint.

Please see this code:
http://synapse.apache.org/apidocs/org/apache/synapse/endpoints/FailoverEndpoint.html
https://svn.apache.org/repos/asf/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/FailoverEndpoint.java

Paul


On Wed, Oct 15, 2008 at 12:58 PM, Andrea_P <an...@fastwebnet.it> wrote:
>
> Hi everyone!!
> I've encountered a problem when I've tried to write a custom mediator.
> My mediator should implement a new version of the standard send mediator;
> when the send, to the current endpoint, fails the mediator should find
> itself a new endpoint to which send the same message. The new endpoint
> should have similar characteristics of the original endpoint.
> But I don't find, in the source code on the official site, some methods to
> understand if the endpoint is active or not.
> Moreover I've tryed some methods to modify the SOAP message addressed to
> Synapse (i.e. I want to add the tag "To"), but nothing seems to work.
> Thanks,
> Andrea.
> --
> View this message in context: http://www.nabble.com/Extending-Synapse---Write-a-new-mediator-tp19992050p19992050.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>



-- 
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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