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: Serializing HTTPClient
Date Tue, 09 Jan 2007 12:27:51 GMT
On Tue, 2007-01-09 at 17:26 +0530, Jagadeesh wrote: 
> Hi All,
> I have a pretty unique problem where I need to serialize the HTTPClient
> object. In my application I have to access an API server which uses REST
> protocol and I have to maintain the session for each and every user. So I
> kept the HTTPClient object in the HTTP session and now when I am trying to
> use load-balancing and clustering, as expected I am running into problems
> with serializing the HTTPClient object which is stored in the HTTP session.
> I would like to know whether there are any workarounds to fix this.


There is no point to serialize the whole damn thing. HttpClient keeps
all its state in a single instance of HttpState class.

Just extend the HttpState class, make it implement Serializable and pass
an instance of this class to HttpClient along with the request to be
executed. Re-use stateless instance(s) of HttpCkient as you see fit.

Hope this helps


> Thanks
> Jugs

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

View raw message