Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log soap requests response time with cxf on the client side?

I'm using cxf to build a client on a soap webservice. Is there any cxf interceptor feature that could automatically measures and logs the webservice response time?

I'm already using org.apache.cxf.interceptor.LoggingInInterceptor and LoggingOutInterceptor for logging the xml content itself.

like image 446
membersound Avatar asked Nov 19 '25 13:11

membersound


1 Answers

CXF has some awesome out of the box features that can help monitor the response times. For this the JMX will need to be enabled.

Refer: http://cxf.apache.org/docs/jmx-management.html

The management api is part of the cxf-rt-management.jar.The features can be enabled against the target endpoint that needs to be monitored using:

org.apache.cxf.management.interceptor.ResponseTimeFeature

This will make use of the following interceptors:

  • org.apache.cxf.management.interceptor.ResponseTimeMessageInInterceptor
  • org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor
like image 109
Ashoka Avatar answered Nov 21 '25 01:11

Ashoka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!