You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Learn Learn <vi...@gmail.com> on 2010/02/02 02:23:05 UTC

Apache httpclient read timeout

Hi,

We have an application on Servicemix that uses ApacheHTTPCLient within it to
handle http based communication. In our flows, we have defined http
endpoints with a socket timeout of 30 seconds and this usually works except
for the case where we establish a connection with the supplier and the
response from the supplier is very very slow. We have seen that such
responses could come after 120 seconds eventhough the socket timeout is set
to 30 seconds. Is there an option to set a different timeout like a read
timeout to handle such situations? Any help will be greatly appreciated.

Regards,
Vijay
-- 
View this message in context: http://old.nabble.com/Apache-httpclient-read-timeout-tp27414268p27414268.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


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


Re: Apache httpclient read timeout

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2010-02-01 at 17:23 -0800, Learn Learn wrote:
> Hi,
> 
> We have an application on Servicemix that uses ApacheHTTPCLient within it to
> handle http based communication. In our flows, we have defined http
> endpoints with a socket timeout of 30 seconds and this usually works except
> for the case where we establish a connection with the supplier and the
> response from the supplier is very very slow. We have seen that such
> responses could come after 120 seconds eventhough the socket timeout is set
> to 30 seconds.

Vijay,

This is perfectly normal. As long as the connection keeps on sending
more packets every 30 seconds, the socket timeout will not fire.

>  Is there an option to set a different timeout like a read
> timeout to handle such situations? Any help will be greatly appreciated.
> 

There is no such parameter. It is up to the consumer of the response
InputStreram to control the timeout value on that connection.

Oleg 


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


Re: Apache httpclient read timeout

Posted by Ken Krugler <kk...@transpac.com>.
FWIW, you could take a look at the SimpleHttpFetcher class in the Bixo  
project.

This supports a "minimum response rate" config setting, which will  
abort a request if the average response rate drops below a threshold.

-- Ken

On Feb 3, 2010, at 2:40pm, Learn Learn wrote:

>
> Oleg,
>
> That's right, but is there a way I can do a "request" timeout? Any  
> option in
> HTTPCLient that would abort a request after a time interval elapses?  
> (time
> interval defined by the timeout)
> -- 
> View this message in context: http://old.nabble.com/Apache-httpclient-read-timeout-tp27414268p27444781.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>

--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c   w e b   m i n i n g





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


Re: Apache httpclient read timeout

Posted by Oleg Kalnichevski <ol...@apache.org>.
Learn Learn wrote:
> Oleg,
> 
> That's right, but is there a way I can do a "request" timeout? Any option in
> HTTPCLient that would abort a request after a time interval elapses? (time
> interval defined by the timeout)

No, there is no such option.

Oleg

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


Re: Apache httpclient read timeout

Posted by Learn Learn <vi...@gmail.com>.
Oleg,

That's right, but is there a way I can do a "request" timeout? Any option in
HTTPCLient that would abort a request after a time interval elapses? (time
interval defined by the timeout)
-- 
View this message in context: http://old.nabble.com/Apache-httpclient-read-timeout-tp27414268p27444781.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


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