You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Daniel Pereda <dp...@mobilitysol.com> on 2007/10/08 01:20:41 UTC

custom mediators for monitoring

Hello!,
    I am working in a project that need to monitor services used in a 
composed service, to determinate certain QoS aggregations metrics for 
the composed service. Synapse seems to be what i'm looking for. The QoS 
metrics necessaries in my project are response time and availability in 
the first time. My idea is create a custom mediator and for each metric 
take a different action, in the response time case generate one mark 
when receive the invoking message and other mark when receiving the 
response message. The mark could be for example a timestamp entry in a 
table on a database.
But i have problems with availability, how can obtain a notification 
when a service is not responding?

Any help is welcome.

Regards.

Dan.

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


Re: custom mediators for monitoring

Posted by Ruwan Linton <ru...@gmail.com>.
Cool... You are welcome.

Ruwan

On 10/10/07, Daniel Pereda <dp...@mobilitysol.com> wrote:
>
> Thanks to reply Ruwan!,  I think that it is what i need, i will test it !
>
> Regards.
>
> Ruwan Linton escribió:
> > Hi Daniel,
> >
> > Here is my idea on how to do the second part (availability).
> >
> > Synapse sequence has an onError sequence associated with it, I think you
> can
> > use that to get a notification on a failure of a service. You might need
> to
> > write another custom mediator if you need to do a specific task on the
> > failure. Here is the configuration for that;
> >
> > <definitions xmlns="http://ws.apache.org/ns/synapse">
> >  <sequence name="main" onError="notifyFailure">
> >    <send><endpoint><address
> uri="$ACTUAL_SERVICE_URL"/></endpoint></send>
> >  </sequence>
> >  <sequence name="notifyFailure">
> >
> >    <!-- your custom mediator should go in here and this will be invoked
> only
> > if there is some error in the sending process. Most probably, to verify
> > that this error was due to the not responding of the service, you will
> need
> > to check the cause of the error inside your custom meditor which can be
> > achieved by checking the error message as follows
> >
> > String errorMessage = synCtx.getProperty(SynapseConstants.ERROR_MESSAGE
> );
> >
> > if (errorMessage.equals($SPECIFIC_ERROR)) { // task on notification}
> >
> > In the same way as the ERROR_MESSAGE you have the access to the
> ERROR_CODE
> > and the ERROR_DETAIL as well. -->
> >
> >   </sequence>
> > </definitions>
> >
> > Hope this will be helpful.
> >
> > Thanks,
> > Ruwan
> >
> > On 10/8/07, Daniel Pereda <dp...@mobilitysol.com> wrote:
> >
> >> Hello!,
> >>     I am working in a project that need to monitor services used in a
> >> composed service, to determinate certain QoS aggregations metrics for
> >> the composed service. Synapse seems to be what i'm looking for. The QoS
> >> metrics necessaries in my project are response time and availability in
> >> the first time. My idea is create a custom mediator and for each metric
> >> take a different action, in the response time case generate one mark
> >> when receive the invoking message and other mark when receiving the
> >> response message. The mark could be for example a timestamp entry in a
> >> table on a database.
> >> But i have problems with availability, how can obtain a notification
> >> when a service is not responding?
> >>
> >> Any help is welcome.
> >>
> >> Regards.
> >>
> >> Dan.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: synapse-user-help@ws.apache.org
> >>
> >>
> >>
> >
> >
> >
>
>
> --
> A/C Daniel Pereda
> Mobility Solutions - http://www.mobilitysol.com
> Fco. Araucho 1362, oficina 105, Montevideo, URUGUAY
> Móvil (+598) 96 199 105
> Teléfono (+598 2) 707 37 95, int 101
> Fax (+598 2) 707 37 95, int 123
>
>
> ---------------------------------------------------------------------
> 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: custom mediators for monitoring

Posted by Daniel Pereda <dp...@mobilitysol.com>.
Thanks to reply Ruwan!,  I think that it is what i need, i will test it !

Regards.

Ruwan Linton escribió:
> Hi Daniel,
>
> Here is my idea on how to do the second part (availability).
>
> Synapse sequence has an onError sequence associated with it, I think you can
> use that to get a notification on a failure of a service. You might need to
> write another custom mediator if you need to do a specific task on the
> failure. Here is the configuration for that;
>
> <definitions xmlns="http://ws.apache.org/ns/synapse">
>  <sequence name="main" onError="notifyFailure">
>    <send><endpoint><address uri="$ACTUAL_SERVICE_URL"/></endpoint></send>
>  </sequence>
>  <sequence name="notifyFailure">
>
>    <!-- your custom mediator should go in here and this will be invoked only
> if there is some error in the sending process. Most probably, to verify
> that this error was due to the not responding of the service, you will need
> to check the cause of the error inside your custom meditor which can be
> achieved by checking the error message as follows
>
> String errorMessage = synCtx.getProperty(SynapseConstants.ERROR_MESSAGE);
>
> if (errorMessage.equals($SPECIFIC_ERROR)) { // task on notification}
>
> In the same way as the ERROR_MESSAGE you have the access to the ERROR_CODE
> and the ERROR_DETAIL as well. -->
>
>   </sequence>
> </definitions>
>
> Hope this will be helpful.
>
> Thanks,
> Ruwan
>
> On 10/8/07, Daniel Pereda <dp...@mobilitysol.com> wrote:
>   
>> Hello!,
>>     I am working in a project that need to monitor services used in a
>> composed service, to determinate certain QoS aggregations metrics for
>> the composed service. Synapse seems to be what i'm looking for. The QoS
>> metrics necessaries in my project are response time and availability in
>> the first time. My idea is create a custom mediator and for each metric
>> take a different action, in the response time case generate one mark
>> when receive the invoking message and other mark when receiving the
>> response message. The mark could be for example a timestamp entry in a
>> table on a database.
>> But i have problems with availability, how can obtain a notification
>> when a service is not responding?
>>
>> Any help is welcome.
>>
>> Regards.
>>
>> Dan.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: synapse-user-help@ws.apache.org
>>
>>
>>     
>
>
>   


-- 
A/C Daniel Pereda 
Mobility Solutions - http://www.mobilitysol.com
Fco. Araucho 1362, oficina 105, Montevideo, URUGUAY
Móvil (+598) 96 199 105
Teléfono (+598 2) 707 37 95, int 101
Fax (+598 2) 707 37 95, int 123


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


Re: custom mediators for monitoring

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

Here is my idea on how to do the second part (availability).

Synapse sequence has an onError sequence associated with it, I think you can
use that to get a notification on a failure of a service. You might need to
write another custom mediator if you need to do a specific task on the
failure. Here is the configuration for that;

<definitions xmlns="http://ws.apache.org/ns/synapse">
 <sequence name="main" onError="notifyFailure">
   <send><endpoint><address uri="$ACTUAL_SERVICE_URL"/></endpoint></send>
 </sequence>
 <sequence name="notifyFailure">

   <!-- your custom mediator should go in here and this will be invoked only
if there is some error in the sending process. Most probably, to verify
that this error was due to the not responding of the service, you will need
to check the cause of the error inside your custom meditor which can be
achieved by checking the error message as follows

String errorMessage = synCtx.getProperty(SynapseConstants.ERROR_MESSAGE);

if (errorMessage.equals($SPECIFIC_ERROR)) { // task on notification}

In the same way as the ERROR_MESSAGE you have the access to the ERROR_CODE
and the ERROR_DETAIL as well. -->

  </sequence>
</definitions>

Hope this will be helpful.

Thanks,
Ruwan

On 10/8/07, Daniel Pereda <dp...@mobilitysol.com> wrote:
>
> Hello!,
>     I am working in a project that need to monitor services used in a
> composed service, to determinate certain QoS aggregations metrics for
> the composed service. Synapse seems to be what i'm looking for. The QoS
> metrics necessaries in my project are response time and availability in
> the first time. My idea is create a custom mediator and for each metric
> take a different action, in the response time case generate one mark
> when receive the invoking message and other mark when receiving the
> response message. The mark could be for example a timestamp entry in a
> table on a database.
> But i have problems with availability, how can obtain a notification
> when a service is not responding?
>
> Any help is welcome.
>
> Regards.
>
> Dan.
>
> ---------------------------------------------------------------------
> 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"