hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: MultiThreadedHttpConnectionManager
Date Thu, 27 Jan 2005 07:52:58 GMT
Hello Gernot,

both versions will work. In the first case, all clients share
the same connection pool, so you can configure a limit
across all sessions. In the second case, each session
will have it's own connection pool, and limits apply only
to that session.


"Pfingstl Gernot" <gernot.pfingstl@stmk.gv.at> 
27.01.2005 08:03
Please respond to
"HttpClient User Discussion"



I'm using httpClient in a webapplication, so I had to use 
In the httpClient docs there's a example how to use 
                 MultiThreadedHttpConnectionManager connectionManager = 
new MultiThreadedHttpConnectionManager();
                 HttpClient client = new HttpClient(connectionManager);
And there's the sentence "This instance of HttpClient can now be used to 
execute multiple methods from multiple threads".  This works fine! But now 
I want to use one HttpClient for a session. So I have one HttpClient 
instance per session, which of course is also multithreaded.
So my question: Can I use MultiThreadedHttpConnectionManager in this way:
                 MultiThreadedHttpConnectionManager connectionManager = 
new MultiThreadedHttpConnectionManager();
                 HttpClient client1 = new HttpClient(connectionManager);
                 HttpClient client2 = new HttpClient(connectionManager);
                 HttpClient client3 = new HttpClient(connectionManager);
or do I have to use it this way:
                 MultiThreadedHttpConnectionManager connectionManager1 = 
new MultiThreadedHttpConnectionManager();
                 HttpClient client1 = new HttpClient(connectionManager1);
                 MultiThreadedHttpConnectionManager connectionManager2 = 
new MultiThreadedHttpConnectionManager();
                 HttpClient client2 = new HttpClient(connectionManager2);
(client1,...,clientN are used in multiple threads)

Thank you,

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message