hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: MultiThreadedHttpConnectionManager used by multiple HttpClient's?
Date Mon, 09 Feb 2009 18:48:23 GMT
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


Mime
View raw message