[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    RE: HttpClient under load
From:       "Prasad Sethumadhavan" <PSethumadhavan () sandcherry ! com>
Date:       2005-02-06 21:11:46
Message-ID: 81EA33D2D997D948BC14AC780BD495847B7B86 () exchange01 ! sccorp ! com
[Download RAW message or body]

Hi Oleg,
Thanks a lot. It works really well.

Thanks
Prasad 

-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: Saturday, February 05, 2005 4:31 AM
To: HttpClient User Discussion
Subject: RE: HttpClient under load

Prasad,

Simply create a separate HttpState instance per thread and pass it as a
parameter to the HttpClient#executeMethod. The global HttpState instance
is used only when the HttpState parameter to executeMethod is null. 

The following code snippet may be helpful:

http://mail-archives.eu.apache.org/mod_mbox/jakarta-httpclient-
user/200501.mbox/%3c1106852264.4926.6.camel@localhost.localdomain%3e

Oleg

On Fri, 2005-02-04 at 20:11 -0700, Prasad Sethumadhavan wrote:
> Hi,
> I am using a single HttpClient that is shared by more than 100
threads.
> Each thread is a separate user and hence should have separate 
> session/cookie information. However, the HttpClient has a single 
> HttpState object that saves all the cookies. How should I go about 
> implementing this?
> 
> Thanks in advance
> Prasad
> 
> -----Original Message-----
> From: Michael Becke [mailto:becke@u.washington.edu]
> Sent: Thursday, February 03, 2005 6:33 AM
> To: HttpClient User Discussion
> Subject: Re: HttpClient under load
> 
> Hi Prasad,
> 
> > I am trying to implement a "fetch timeout" feature using the http 
> > client. Basically it means that if I have not received a complete 
> > response within "n" seconds then I need to return a fetch timeout.
> > Is there any built in mechanism in HttpClient for this or do I need 
> > to
> 
> > have a monitor thread that calls HttpMethod.abort() after the 
> > timeout period (if the method has not finished execution). What 
> > would be the result of calling the abort method on the worker 
> > thread? (what exceptions etc..). Please advise if there are any 
> > better ways to implement the same.
> 
> HttpMethod.abort() is the way to go.  You will need to keep track of 
> the execution time and abort the methods from a separate thread.
> Calling abort will most likely cause an IOException but it depends 
> where exactly the method is in the process of execution.
> 
> Mike
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> httpclient-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> httpclient-user-help@jakarta.apache.org
> 


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




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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic