Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5768

Axis2 (1.4.1) Client Connection Issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • transports
    • None

    Description

      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();
      params.setDefaultMaxConnectionsPerHost(50);
      params.setMaxTotalConnections(50);
      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.
      httpClient.getHttpConnectionManager().closeIdleConnections(30000);

      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 ?

      -------------------------------------------------------------------------------------

      As per your previous reply axis 1.4.1 is not supported anymore. So we upgraded to axis 1.7.1.

      With reference to the below link, it says that reusing Http client is handled internally and need not be explicitly handled in the user program.

      https://axis.apache.org/axis2/java/core/docs/http-transport.html

      [" in earlier versions of Axis2 the REUSE_HTTP_CLIENT configuration property was necessary to enable this functionality, but as of 1.5 this is no longer necessary"]

      But when we triggered 100 requests, we found that 100 connections were created and as mentioned in the document, the connections were not reused.

      ----------------------------------------------------------------------------------------------------
      RE-OPENING THE TICKET FOR Ver 1.7.2
      ----------------------------------------------------------------------------------------------------

      As per your previous reply axis 1.4.1 is not supported anymore. So we upgraded to axis 1.7.1.

      With reference to the below link, it says that reusing Http client is handled internally and need not be explicitly handled in the user program.

      https://axis.apache.org/axis2/java/core/docs/http-transport.html

      [" in earlier versions of Axis2 the REUSE_HTTP_CLIENT configuration property was necessary to enable this functionality, but as of 1.5 this is no longer necessary"]

      But when we triggered 100 requests, we found that 100 connections were created and as mentioned in the document, the connections were not reused.

      Attached the screenshot for your reference

      Attachments

        1. ConnectionIssue.jpg
          195 kB
          Rajesh

        Activity

          People

            Unassigned Unassigned
            rajeshin1 Rajesh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: