osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retrieving time taken to invoke a remote endpoint


Hi Rajith,
perhaps you can take a look at creating a interceptor[1] to do that.

zoran

[1] https://github.com/apache/camel/blob/master/docs/user-manual/en/intercept.adoc

On Thu, Nov 8, 2018 at 2:16 PM, Rajith Muditha Attapattu
<rajith77@xxxxxxxxx> wrote:
> Assume a route as follows
> ......
> .to(myRemoteEndpoint)
> .log(...)
>
> I was wondering if there's a way to retrieve the time taken to invoke the
> remote endpoint so it can be logged in the next step?
>
> I'm aware that we can define an id for that step and use jmx or we can use
> an event listener and use getTimeTaken() on the EXCHANGE_SENT event.
> But in both cases we have to deal with all event/metrics to get the one we
> want.
>
> Additionally we want to log the time taken with other data related to that
> particular exchange which will not be visible in the other approaches.
>
> Any guidance is much appreciated.
>
> Regards,
>
> Rajith <http://rajith.2rlabs.com/>



-- 
Zoran Regvart