hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dobri Kitipov <kdobrik.ax...@googlemail.com>
Subject Reuse of HTTPClient among different invocations is ok, what about different Web Services, hosts?
Date Thu, 19 Mar 2009 12:13:17 GMT
Hi everybody,
when we reuse HTTPClient underneath each subsequent call to
HttpClient.executeMethod() will go to the connection manager
(MultiThreadedHttpConnectionManager) and ask for an instance of
HttpConnection. I have tested some use cases when a HTTPClient is reused for
invocation of a single WS and I can verify there is socket reuse. So far so
good.

Anyway, my question is: could we expect any problems when reusing HTTPClient
among different threads calling different WSs which are deployed at
different hosts/servers?
As stated at - http://hc.apache.org/httpclient-3.x/threading.html - there is
a test case that demonstrates how HTTPClient can be reused among different
threads which in turn invoke different web services (WSs). My concern is
that HTTPClient has HttpState which I am not sure could be reused/shared
among different WSs invocations (JavaDoc says for HttpState: "A container
for HTTP attributes that may persist from request to request, such as {@link
Cookie cookies} and authentication {@link Credentials credentials}.")? Can
different WS clients share one HttpClient and its HttpState among different
threads and invoking different WSs (e.g. at differnet hosts)?

Thank you in advance,
Dobri

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