Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 74140 invoked from network); 9 Feb 2009 18:49:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2009 18:49:04 -0000 Received: (qmail 33827 invoked by uid 500); 9 Feb 2009 18:49:03 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 33806 invoked by uid 500); 9 Feb 2009 18:49:03 -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 33795 invoked by uid 99); 9 Feb 2009 18:49:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 10:49:03 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [217.150.250.44] (HELO ok2consulting.nine.ch) (217.150.250.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Feb 2009 18:48:53 +0000 Received: by ok2consulting.nine.ch (Postfix, from userid 1002) id 6B0D5198569; Mon, 9 Feb 2009 19:48:31 +0100 (CET) Received: from [192.168.1.102] (84-75-111-165.dclient.hispeed.ch [84.75.111.165]) by ok2consulting.nine.ch (Postfix) with ESMTP id CDD1A198560 for ; Mon, 9 Feb 2009 19:48:30 +0100 (CET) Message-ID: <49907A77.8040308@apache.org> Date: Mon, 09 Feb 2009 19:48:23 +0100 From: Oleg Kalnichevski User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: HttpClient User Discussion Subject: Re: MultiThreadedHttpConnectionManager used by multiple HttpClient's? References: <28210.3423.qm@web50107.mail.re2.yahoo.com> In-Reply-To: <28210.3423.qm@web50107.mail.re2.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on ok2consulting.nine.ch X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.3 Will McQueen wrote: > Hi, > > Is a singe instance of MultiThreadedHttpConnectionManager designed to be used with more than one HttpClient? eg: > > > MultiThreadedHttpConnectionManager connMgr = new MultiThreadedHttpConnectionManager(); //used with both client1 and client2 > > HttpClient client1 = new HttpClient(); > client1.setHttpConnectionManager(connMgr); > > HttpClient client2 = new HttpClient(); > client1.setHttpConnectionManager(connMgr); > > > I'd like to run heavily multithreaded tests against 3 diff't hosts with HttpClient, interleaved. Is it common practice to give each target host its own HttpClient (which in turn has its own MT connMgr)? Or, is it common to pass-in a diff't hostConfig for each method execution, like this: > client.executeMethod(hostConfig, httpMethod, httpState); > > Thank you. > > Cheers, > Will > Hi Will Both approaches are perfectly valid, but I would recommend the latter (one connection manager). Oleg > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org > For additional commands, e-mail: httpclient-users-help@hc.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org