Further the pseudo code of the mediator will be;
if (msgCtx.isResponse()) {
long req_tm_stmp = Long.parseLong(msgCtx.getProperty("TM_STMP"));
response_time = System.currentTimeMillis() - req_tm_stmp;
// store the response time
} else {
msgCtx.setProperty("TM_STMP", System.currentTimeMillis());
}
Thanks,
Ruwan
On Thu, Apr 17, 2008 at 8:52 PM, Ruwan Linton <[EMAIL PROTECTED]>
wrote:
> Hi Daniel,
>
> Nice to see you back,
>
> I think the ideal solution is to set the time stamp you generated before
> sending the request out (i.e. inside in mediator) as a message context
> property and you can retrieve that on the custom mediator at the out
> mediator, so that you can take the difference of the current time stamp and
> the time stamp retrieved from the message context (request sending time
> stamp) to find the response time.
>
> Hope this will help you.
>
> Thanks,
> Ruwan
>
>
> On Thu, Apr 17, 2008 at 8:04 PM, Asankha C. Perera <[EMAIL PROTECTED]>
> wrote:
>
> > Daniel
> >
> > > The ResponseTimeMediator is called when invoke the service and when
> > > receive the response, so i generate a timestamp in each step but i face a
> > > problems to find a call identifier to match the entry call with the
> > > response
> > > call.
> > >
> > If you add a property to the "incoming" Synapse message context in your
> > custom mediator, the corresponding response Synapse message context should
> > have the same property. (e.g. Sample 51 <
> > http://synapse.apache.org/Synapse_Samples.html#Sample51>)
> >
> > asankha
> >
>
>
>
> --
> Ruwan Linton
> http://www.wso2.org - "Oxygenating the Web Services Platform"
--
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"