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: HttpCore/HttpClient services integration in a J2EE Servlet container
Date Sun, 14 Nov 2010 11:53:09 GMT
On Sat, 2010-11-13 at 11:30 +0100, Javier Ramos wrote:
> Hello,
> I am currently using HttpClient 3.1 inside a servlet that needs to retrieve
> XML content from several webs, which must be a very common need.
> I am thinking of moving my code  to HttpCore or HttpClient 4.
> Before I make the transition I am researching for best practices using
> HttpCore or HttpClient inside a servlet container.

My personal recommendation would be to wrap HttpClient or a custom HTTP
client based on HttpCore into a stateless session bean. In both cases
you should be using only a single connection per instance and let the
container manage a pool of instances. You should not be using a pooling
HTTP connection manager such ThreadSafeClientConnManager inside an EJB

> I came up with the idea that it would be good to have a managed http client
> service inside the J2EE container, in such a way that the applications could
> get a client via JNDI lookup, in a similar way as they get connections from
> a database connection pool. Ideally, from the J2EE console or from another
> webapp, it would be nice to be able to monitor and administrate HTTP
> connections to the different hosts: setup connection parameters for
> different hosts at runtime, block slow performing hosts...
> Does anybody know if there is any J2EE container offering such capabilities
> ?
> Or some product / webapp that extends J2EE capabilities in such a way ?

None I am aware of


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

View raw message