hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Sánchez <inganto...@gmail.com>
Subject Multithreaded http client application: how-to?
Date Wed, 06 Oct 2010 21:21:18 GMT

I'm developing a Swing client application for requesting a web
application (Struts2). 

This client application is required to deal with concurrent requests
(SwingWorkers) that will finally be performed using HttpClient4.

All request will have the same URL: "http://www.myhost.com/mywebapp",
only query string will change:

The application must be session aware (JSESSIONID cookie) and possibly
will require to generally manage some other HTTP state.

My questions:

1. Should I share the same HttpClient instance for all requests
(concurrent or not)? Or should I instantiate a new HttpClient for every
new request (concurrent or not)?

2. Should I use a 'ThreadSafeClientConnManager as stated in
http://hc.apache.org/httpcomponents-client-4.0.3/tutorial/html/connmgmt.html#d4e629 ? Or using
a new HttpClient instance for every concurrent request is enough?

Thanks and regards.

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

View raw message