[ 
https://issues.apache.org/jira/browse/AXIS2-5768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15285983#comment-15285983
 ] 

Rajesh commented on AXIS2-5768:
-------------------------------

Hi,

Let me give you the big picture.


There is a service provider hosted by a third party. From our end we are trying 
to consume that web service.

We have a axis2 client java component hosted in the middleware server. The end 
users (application) will hit the middleware via the SOAP Url. The middleware 
will receive the request and pass it to the axis2 client component which in 
turn will hit the third party service provider.

So as mentioned in the previous post, I used the SOAP UI to generate 100 
requests only to the middleware and not the service provider directly. These 
100 requests will be passed to axis2 client component which is creating 100 
connections for all these 100 requests.

Hope the context is clear.

Thanks

> Axis2 (1.4.1) Client Connection Issue
> -------------------------------------
>
>                 Key: AXIS2-5768
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5768
>             Project: Axis2
>          Issue Type: Bug
>          Components: transports
>            Reporter: Rajesh
>         Attachments: ConnectionIssue.jpg
>
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to