Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 42021 invoked from network); 7 Oct 2010 15:11:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Oct 2010 15:11:35 -0000 Received: (qmail 62831 invoked by uid 500); 7 Oct 2010 15:11:35 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 62785 invoked by uid 500); 7 Oct 2010 15:11:34 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 62777 invoked by uid 99); 7 Oct 2010 15:11:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 15:11:34 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andresr@corp.moniker.com designates 66.232.8.193 as permitted sender) Received: from [66.232.8.193] (HELO outboundmx.flt1.oversee.net) (66.232.8.193) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Oct 2010 15:11:27 +0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CB6631.DDB6B37E" X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: Miltiple Independent connection to the same Host Date: Thu, 7 Oct 2010 11:11:05 -0400 Message-ID: <886461EE661A1E45BAA97AF28FAA85DB034972EF@barbados.corp.oversee.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Miltiple Independent connection to the same Host Thread-Index: ActmMdywuoMH6x3mSLWzgQJuFg8hpA== From: "Andres Rangel" To: ------_=_NextPart_001_01CB6631.DDB6B37E Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I am in the process of redesigning a multithreaded application that is doing XML over http using httpclient vr 4 =20 We currently have a pool of threads, and each one opens and closes the connection all the time (we are using commons-http) =20 We have a restriction of X number of request per connection before closing it (which we have ignored, since we are opening and closing it all the time) =20 My question is the following: =20 I know that using ThreadSafeClientConnManager the client can be shared across multiple threads, but is not the case here, since each thread will have it's own connection. =20 How can I reuse the connection in each thread? =20 Do I keep the HttpClient in a local variable and just reuse it inside each thread? Thanks =20 Andres Rangel ------_=_NextPart_001_01CB6631.DDB6B37E--