2

Currently we're using Apache Camel (with Spring Boot) as an Integration platform. We have multiple backend systems to integrate. Mostly we use Apache CXF and CXF RS to call to those systems.

We'd like to log how much time we wait for the backend systems, and how much overhead is put on by our application.

We've created an EventNotifierSupport bean, where we can log the following:

  • The time between the ExchangeCreatedEvent and the ExchangeCompletedEvent events. I think this is the full time approximately it takes to serve the request. (full time as our overhead and the backend system's time)

  • And I can log the timeTaken property of the ExchangeSentEvent˙notification.

I have a problem with the latter. Under high load it takes pretty much time for our application to process the SOAP response and this time is included into the timeTaken property.

What's the proper Camel-way to measure the time we wait for backend systems?

Nagy Vilmos
  • 1,878
  • 22
  • 46

2 Answers2

0

Camel supports traceability via JMX support out-of-the-box. You can drill down at various resolutions such as routes or individual endpoints in real time, and it can report min/max/mean time for completion and more just using JConsole. This should at least give you some insight into the request->response time for backend processes called on individual endpoints.

See here.

Gerry Mantha
  • 1,068
  • 7
  • 14
  • Yeah, I've seen some of those metrics, but I've not seen any one to be as verbose as I'd like to. – Nagy Vilmos Oct 31 '17 at 19:20
  • 1
    You need to dive into whatever Camel component you use for the SOAP call and use its logging or whatever it has for timing at that fine level. Or look at some TCP packet level networking tooling etc. – Claus Ibsen Nov 01 '17 at 07:32
  • Claus, we replaced the backend with a mock response simulator which sends each response with a fixed 500ms delay. Our integration platform having a huge load returns measurements as long as 25-30 seconds using the Camel `timeTaken` property for the CXF component while we have proof that the response has arrived in about 510ms every time. – Kristof Jozsa Nov 02 '17 at 08:43
0

For the record: I think I'd be able to measure a more precise time for the SOAP requests, if

  • I've implemented an org.apache.cxf.interceptor.Interceptor (based on the org.apache.cxf.interceptor.MessageSenderInterceptor.MessageSenderEndingInterceptor class - I needed to set the constructor arguments also!)
  • And I register this interceptor to the CXF endpoint as it's mentioned here: http://camel.apache.org/cxf.html

I think the SOAP responses are consumed in a separate ThreadPool, and under high load it takes much time to consume a response object from the pool's queue. But if I set up the CXF interceptor as mentioned above it runs before the response is put into the queue.

I've not tested this solution, and not implemented any more of it. But if I'd face this problem in the future (hello future-googler me!), I'd start looking at these places.

Nagy Vilmos
  • 1,878
  • 22
  • 46