0

I have cxf web service and i'm using Asynchronous method calls. I'm using Callback approach ( using javax.xml.ws.AsyncHandler - http://cxf.apache.org/docs/developing-a-consumer.html ) to get the response as follows

 Future<?> asyncResponse = myWebService.testMethodAsync(param, new MyAsyncHandler());

This method works fine and I get the correct response.

My problem is the performance. I measured the time taken just for above line and my application showing around 2000ms just for above line ( I did the test using jmeter). My application is deployed in tomcat and stated unusual delay happens after jmeter start nearly 50 threads. At the beginning of the test delay is under 5ms. But after few minutes it suddenly reach to near 1000ms then vary between approximately 900ms to 2000ms for 97% of the requests.

I did the same test using standalone java cxf async client instead web application, but in that test above line always return under 5ms. Therefore I'm suspecting, in my web application there might be problem with thread scheduling ( because my web application do lot of other things while running the test and i can not stop these services without making drastic changes) OR is there any other problem here ? May be running out of thread pool used by cxf async client ?

Viraj
  • 5,083
  • 6
  • 35
  • 76

1 Answers1

1

The problem is CXF loads CXF load default HTTPUrlConnection in JDK which is synchronized ( loaded conduit is org.apache.cxf.transport.http.URLConnectionHTTPConduit) because necessary jars are not included in classpath. Resolved class path issue and now loading correct conduit ( org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit). More info can be found in here

Community
  • 1
  • 1
Viraj
  • 5,083
  • 6
  • 35
  • 76