On Nov 24, 2009, at 5:23am, Håkon Sagehaug wrote:
Hi all,
I've got a web service that pulls files for different sources, among
http,
and I huse HttpClient for this, so my question is. If I create a
Httpclient
from ThreadSafeClientConnManager, can I then have one
instance(static) of
HttpClient that is shared between the instances of the web service.
So I can
save some resources and also not creating a new HttpClient for each
request.
Yes, that's correct.
Note that by default the ThreadSafeClientConnManager has a limit of 20
simultaneous connections, so you might need to increase that limit.
-- Ken
PS - See http://hc.apache.org/httpcomponents-client/tutorial/html/ for
lots of useful info, especially http://hc.apache.org/httpcomponents-client/tutorial/html/connmgmt.html#d4e629
cheers, Håkon
--
Håkon Sagehaug, Scientific Programmer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)
[email protected], phone +47 55584125
--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c w e b m i n i n g
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]