Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Axis2 Client Connection Issue

Se Rajesh
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java(axis2 1.4.1 client) component in middleware which consumes a web service hosted in another application. Am facing some issues in it.

Please find the code snippet below
ConfigurationContext configContxt;
MultiThreadedHttpConnectionManager connxMgr = new MultiThreadedHttpConnectionManager();
HttpConnectionManagerParams params = connxMgr.getParams();
connxMgr .setParams(params);
HttpClient client = new HttpClient(connxMgr);
configContxt.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, "True");

Please help to clarify the below queries,

1. Whenever a new request comes in, a new connection is getting created. This can be confirmed by doing 'netstat -a|grep <<provider URI>>'

When we were using axis2 1.3v client earlier there was no new connection created, please clarify why this is creating a new connection while using axis2 1.4.1?

To prevent this, I have set REUSE_HTTP_CLIENT property in ConfigurationContext to TRUE. So this will reuse the existing (already established) connection to the server.

2. I have set the setDefaultMaxConnectionsPerHost and setMaxTotalConnections as 50. When I do the load test from SoapUI by triggering 50 requests, only 3 connections were created. Later I increased to 200 requests, but still the connections count didnt exceed 3.

Am not sure why it is not able to serve with only one connection (since reuse property is used) and also why the number of connections did not gradually increase with the number of requests (3 connx for 50 requests and again same 3 connx for 200 requests)

How will the reuse propery (HTTPConstants.REUSE_HTTP_CLIENT) behave ?

3. How many transactions can be done per connection concurrently while using " REUSE_HTTP_CLIENT property" in the code?

4. Another Issue is:
I have set the closeIdleConnections with the timeout of 30 secs.

Even this is not working. The unused connections are closed only after 5 mins.
I just want to know If there could be some property set at server side which overriding this 30 seconds which am setting at client side ?

Can someone help me on the above ?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic