Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 75082 invoked from network); 24 Jan 2006 15:48:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Jan 2006 15:48:13 -0000 Received: (qmail 86710 invoked by uid 500); 24 Jan 2006 15:48:10 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 86675 invoked by uid 500); 24 Jan 2006 15:48:10 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 86653 invoked by uid 99); 24 Jan 2006 15:48:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jan 2006 07:48:10 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [195.186.19.66] (HELO mail22.bluewin.ch) (195.186.19.66) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jan 2006 07:48:09 -0800 Received: from [192.168.0.3] (62.203.2.213) by mail22.bluewin.ch (Bluewin 7.2.070) id 43C618A3003AC509 for httpclient-user@jakarta.apache.org; Tue, 24 Jan 2006 15:47:48 +0000 Subject: Re: minimum object creation From: Oleg Kalnichevski To: HttpClient User Discussion In-Reply-To: References: Content-Type: text/plain Date: Tue, 24 Jan 2006 16:47:47 +0100 Message-Id: <1138117667.8299.41.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Tue, 2006-01-24 at 16:24 +0100, klaus.kopruch@Materna.de wrote: > Hello * ! > > I'm developing a java component which sends requests to multiple http > servers. I have the requirement that the following properties have to be > adjustable per host/port: > > + basic authentication (usr/pwd) > + http version 1.0 or 1.1 > + proxy using > + socket and connection timeout > + max. connections per host > > I dont want to create more objects than really needed, but I think I have to > create the following instances: > > + HttpClient per host: basic authentication (usr/pwd) You could also use an HttpState instance instead > + HostConfiguration per host: proxy using You can also set a host-specific socket timeout value here > + HttpConnectionManager per host: socket and connection timeout, max. > connections per host This is the only way to set a host-specific connect timeout value. However, if you are prepared to live with the same connect timeout value for all the hosts, I would recommend using a shared connection manager > + HttpMethod per request > Yep > Do I have to create at least these instances, or is it possible to have only > one instance of HttpClient ? You should reuse HttpClient if you are also going to reuse the connection manager. Otherwise you should create an instance of HttpClient per host (along with an instance of the connection manager) > If I could set the socket and connection timeout in the HostConfiguration I > can manage with only one instance of HttpConnectionManager, but this seems > not to be possible ? > It is not possible to set the connect timeout on a per host basis Hope this helps Oleg > Any suggestions ? > > Thanks > > Klaus > > --------------------------------------------------------------------- > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org