Discussion:
Retrieving time taken to invoke a remote endpoint
Rajith Muditha Attapattu
2018-11-08 13:16:39 UTC
Permalink
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
2018-11-09 09:35:47 UTC
Permalink
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
Post by Rajith Muditha Attapattu
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
Claus Ibsen
2018-12-01 10:50:45 UTC
Permalink
Hi

And there is also this little example
http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.html
Post by Zoran Regvart
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
Post by Rajith Muditha Attapattu
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
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Continue reading on narkive:
Search results for 'Retrieving time taken to invoke a remote endpoint' (Questions and Answers)
5
replies
can i get question answer of asp.net ?
started 2006-10-11 00:02:47 UTC
software
Loading...