I just tested the example code in HttpClient, 'MultiThreadedExample.java' (modified so that it runs forever). It reuses the pool of connections. I do not see it creating new connection all the time.
Should I enter a bug? kamal -----Original Message----- From: Davanum Srinivas [mailto:[EMAIL PROTECTED] Sent: Friday, May 04, 2007 11:26 AM To: axis-user@ws.apache.org Subject: Re: AbstractHTTPSender not releasing connection Ok then try this tactic. Can you get hold of the OperationContext for each invocation? Typically you can use myServiceContext.getLastOperationContext() to get the last OperationContext. You will have to start caching them though by calling myServiceClient.setCachingOperationContext(true) or you can create the OperationContext by calling myServiceContext.createOperationContext as well. Either way after the invocation is done you can call the following snippet to cleanup the HttpMethod. myOperationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VAL UE); _messageContext.getTransportOut().getSender().cleanup(_messageContext); thanks, dims On 5/4/07, Michele Mazzucco <[EMAIL PROTECTED]> wrote: > Dims, > > what do you mean by "calling the complete method"?. In this scenario I'm > using simple ServiceClient(s) sharing the same conf. context and > attached to custom callbacks (I'm reusing the same ServiceClients for > thousands of asynchronous requests). > For my knowledge (see the link below) the cleanup (on the ServiceClient) > should be called only at the end which, as I said, is after receiving > thousands of responses. > Are you then suggesting me to share an OperationClient for all my > requests and to free resources as soon as I receive the response? > > Thanks, > Michele > > http://www.nabble.com/-Axis2--ServiceClient-question-tf2496516.html#a907 8044 > > On Fri, 2007-05-04 at 10:56 -0400, Davanum Srinivas wrote: > > Michele, > > > > Are you calling the complete method in OperationClient? that calls the > > cleanup method in the TransportSender. I believe we are doing that > > automatically in generated stubs as well where we generate the > > following call. > > > > _messageContext.getTransportOut().getSender().cleanup(_messageContext); > > > > that calls the releaseConnection on the HttpMethod. > > > > -- dims > > > > On 5/4/07, Michele Mazzucco <[EMAIL PROTECTED]> wrote: > > > But that workaround works only on Windows :( > > > > > > Michele > > > > > > On Fri, 2007-05-04 at 10:18 -0400, Davanum Srinivas wrote: > > > > Guess the only work around is the tuning parameters as mentioned > > > > there...so it's a no-op fo us. There's nothing we can do..is there? > > > > > > > > -- dims > > > > > > > > On 5/4/07, Michele Mazzucco <[EMAIL PROTECTED]> wrote: > > > > > Dims, > > > > > > > > > > please see here > > > > > https://issues.apache.org/jira/browse/AXIS2-2593 > > > > > > > > > > > > > > > Michele > > > > > > > > > > On Fri, 2007-05-04 at 09:59 -0400, Davanum Srinivas wrote: > > > > > > Michele, > > > > > > > > > > > > Here's what is see in the http client code: > > > > > > http://svn.apache.org/repos/asf/jakarta/commons/proper/httpclient/trunk/ src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManage r.java > > > > > > > > > > > > /** The default maximum number of connections allowed per host */ > > > > > > public static final int DEFAULT_MAX_HOST_CONNECTIONS = 2; // Per > > > > > > RFC 2616 sec 8.1.4 > > > > > > > > > > > > /** The default maximum number of connections allowed overall */ > > > > > > public static final int DEFAULT_MAX_TOTAL_CONNECTIONS = 20; > > > > > > > > > > > > Could the new threads being created because the old ones are still in > > > > > > progress? can you bump up the default limits and try? > > > > > > > > > > > > -- dims > > > > > > > > > > > > On 5/4/07, Michele Mazzucco <[EMAIL PROTECTED]> wrote: > > > > > > > Dims, > > > > > > > > > > > > > > even if the HttpClient is cached new connections are created every 3/4 > > > > > > > requests. > > > > > > > > > > > > > > Michele > > > > > > > > > > > > > > On Fri, 2007-05-04 at 09:44 -0400, Davanum Srinivas wrote: > > > > > > > > Kamaljeet, > > > > > > > > > > > > > > > > can you try the 2nd option here: > > > > > > > > http://wso2.org/library/87 > > > > > > > > > > > > > > > > -- dims > > > > > > > > > > > > > > > > On 5/4/07, Kang, Kamaljeet K. <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > I turned the HttpClient log on and from the log it looks like new > > > > > > > > > connection is created for every request. I am sending request every 1 > > > > > > > > > sec so connection shouldn't idle out. I think, AbstractHTTPSender is not > > > > > > > > > releasing the connection back to the pool so > > > > > > > > > 'MultiThreadedHttpConnectionManager cleanup' thread is trashing it after > > > > > > > > > 1 use. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >>>>>>>> Log > > > > > > > > > > > > > > > > > > 04-May 08:11:22,184 DEBUG httpclient.MultiThreadedHttpConnectionManager > > > > > > > > > [PRIMARY_SUBSCRIBER_FAULT_TOPIC] - Unable to get a connection, > > > > > > > > > waiting..., hostConfig=HostConfiguration[host=http://localhost:8081] > > > > > > > > > **********ProbCause*****PROP_TEST > > > > > > > > > 04-May 08:52:15,369 DEBUG httpclient.MultiThreadedHttpConnectionManager > > > > > > > > > [MultiThreadedHttpConnectionManager cleanup] - Connection reclaimed by > > > > > > > > > garbage collector, > > > > > > > > > hostConfig=HostConfiguration[host=http://localhost:8081] > > > > > > > > > 04-May 08:52:15,369 DEBUG httpclient.MultiThreadedHttpConnectionManager > > > > > > > > > [MultiThreadedHttpConnectionManager cleanup] - enter > > > > > > > > > HttpConnectionManager.ConnectionPool.getHostPool(HostConfiguration) > > > > > > > > > 04-May 08:52:15,369 DEBUG httpclient.MultiThreadedHttpConnectionManager > > > > > > > > > [MultiThreadedHttpConnectionManager cleanup] - enter > > > > > > > > > HttpConnectionManager.ConnectionPool.getHostPool(HostConfiguration) > > > > > > > > > 04-May 08:52:15,369 DEBUG httpclient.MultiThreadedHttpConnectionManager > > > > > > > > > [MultiThreadedHttpConnectionManager cleanup] - Notifying thread waiting > > > > > > > > > on host pool, hostConfig=HostConfiguration[host=http://localhost:8081] > > > > > > > > > 04-May 08:52:15,369 DEBUG httpclient.MultiThreadedHttpConnectionManager > > > > > > > > > [PRIMARY_SUBSCRIBER_FAULT_TOPIC] - enter > > > > > > > > > HttpConnectionManager.ConnectionPool.getHostPool(HostConfiguration) > > > > > > > > > 04-May 08:52:15,369 DEBUG httpclient.MultiThreadedHttpConnectionManager > > > > > > > > > [PRIMARY_SUBSCRIBER_FAULT_TOPIC] - Allocating new connection, > > > > > > > > > hostConfig=HostConfiguration[host=http://localhost:8081] > > > > > > > > > 04-May 08:52:15,369 DEBUG httpclient.HttpMethodDirector > > > > > > > > > [PRIMARY_SUBSCRIBER_FAULT_TOPIC] - Attempt number 1 to process request > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > Kamal > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > > > From: Michele Mazzucco [mailto:[EMAIL PROTECTED] > > > > > > > > > Sent: Friday, May 04, 2007 4:22 AM > > > > > > > > > To: axis-user@ws.apache.org > > > > > > > > > Subject: Re: AbstractHTTPSender not releasing connection > > > > > > > > > > > > > > > > > > Hi Kamal, > > > > > > > > > > > > > > > > > > HttpClient by default uses persistent (keep alive) connections, however > > > > > > > > > every few requests a new connection is created. > > > > > > > > > > > > > > > > > > Michele > > > > > > > > > > > > > > > > > > On Thu, 2007-05-03 at 16:15 -0400, Kang, Kamaljeet K. wrote: > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > > > As per HTTPClient documentation if you are using > > > > > > > > > > MultiThreadedhttpConnectionManager then for every > > > > > > > > > > HttpClient.executeMethod there has to be corresponding > > > > > > > > > > 'releaseConnection' call. I do not see AbstractHttpSender releasing > > > > > > > > > > connection anywhere in the code. Is this the reason why even after > > > > > > > > > using > > > > > > > > > > REUSE_HTTP_CLIENT, we see new HTTP connection created for every > > > > > > > > > > request/response? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > Kamal > > > > > > > > > > ============================================================ > > > > > > > > > > The information contained in this message may be privileged > > > > > > > > > > and confidential and protected from disclosure. If the reader > > > > > > > > > > of this message is not the intended recipient, or an employee > > > > > > > > > > or agent responsible for delivering this message to the > > > > > > > > > > intended recipient, you are hereby notified that any reproduction, > > > > > > > > > > dissemination or distribution of this communication is strictly > > > > > > > > > > prohibited. If you have received this communication in error, > > > > > > > > > > please notify us immediately by replying to the message and > > > > > > > > > > deleting it from your computer. Thank you. Tellabs > > > > > > > > > > ============================================================ > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > ============================================================ > > > > > > > > > The information contained in this message may be privileged > > > > > > > > > and confidential and protected from disclosure. If the reader > > > > > > > > > of this message is not the intended recipient, or an employee > > > > > > > > > or agent responsible for delivering this message to the > > > > > > > > > intended recipient, you are hereby notified that any reproduction, > > > > > > > > > dissemination or distribution of this communication is strictly > > > > > > > > > prohibited. If you have received this communication in error, > > > > > > > > > please notify us immediately by replying to the message and > > > > > > > > > deleting it from your computer. Thank you. Tellabs > > > > > > > > > ============================================================ > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Davanum Srinivas :: http://davanum.wordpress.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ============================================================ The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reproduction, dissemination or distribution of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Tellabs ============================================================ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]