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 Martin Ždila <m....@gmail.com> on 2011/03/09 14:08:22 UTC

HttpPost is being retried

Hello

We are using HttpPost method with DefaultHttpClient. The server processing
takes couple of minutes without any response during this time. I would
expect the HttpPost execution to timeout because POST method is not
repeatable. Instead it is repeated. Is this a bug?

9.3.2011 13:45:34 org.apache.http.impl.client.DefaultRequestDirector execute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when
processing request: The target server failed to respond
9.3.2011 13:45:34 org.apache.http.impl.client.DefaultRequestDirector execute
INFO: Retrying request
9.3.2011 13:48:55 org.apache.http.impl.client.DefaultRequestDirector execute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when
processing request: The target server failed to respond
9.3.2011 13:48:55 org.apache.http.impl.client.DefaultRequestDirector execute
INFO: Retrying request
... (loops forever)

Thanks in advnce
Best regards
-- 
Ing. Martin Ždila
tel:+421-908-363-848
mailto:martin@zdila.sk
http://www.zdila.sk/

RE: HttpPost is being retried

Posted by Razvan Mihailescu <ra...@computaris.com>.
Hi,

You may need to implement your own HttpRequestRetryHandler, as the one provided by default by http-client does a number of retries by default - DefaultHttpRequestRetryHandler.
You will need to set the new retry handler property on your HttpClient. See AbstractHttpClient setHttpRequestRetryHandler method.

Razvan

-----Original Message-----
From: Martin Ždila [mailto:m.zdila@gmail.com] 
Sent: Wednesday, March 09, 2011 3:08 PM
To: httpclient-users@hc.apache.org
Subject: HttpPost is being retried

Hello

We are using HttpPost method with DefaultHttpClient. The server processing
takes couple of minutes without any response during this time. I would
expect the HttpPost execution to timeout because POST method is not
repeatable. Instead it is repeated. Is this a bug?

9.3.2011 13:45:34 org.apache.http.impl.client.DefaultRequestDirector execute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when
processing request: The target server failed to respond
9.3.2011 13:45:34 org.apache.http.impl.client.DefaultRequestDirector execute
INFO: Retrying request
9.3.2011 13:48:55 org.apache.http.impl.client.DefaultRequestDirector execute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when
processing request: The target server failed to respond
9.3.2011 13:48:55 org.apache.http.impl.client.DefaultRequestDirector execute
INFO: Retrying request
... (loops forever)

Thanks in advnce
Best regards
-- 
Ing. Martin Ždila
tel:+421-908-363-848
mailto:martin@zdila.sk
http://www.zdila.sk/


This email is subject to Computaris email terms of use: http://www.computaris.com/email_terms

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


Re: HttpPost is being retried

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2011-03-09 at 15:14 +0100, Martin Ždila wrote:
> On Wed, Mar 9, 2011 at 3:02 PM, Razvan Mihailescu <
> razvan.mihailescu@computaris.com> wrote:
> 
> > You may need to implement your own HttpRequestRetryHandler, as the one
> > provided by default by http-client does a number of retries by default -
> > DefaultHttpRequestRetryHandler.
> > You will need to set the new retry handler property on your HttpClient. See
> > AbstractHttpClient setHttpRequestRetryHandler method.
> >
> 
> Thanks for your answer. I am aware that I can somehow configure it (now I
> know I have to implement my own HttpRequestRetryHandler) but I would expect
> that DefaultHttpClient works like standards say: not to retry POST method.
> This should be default behavior of the DefaultHttpClient without any extra
> configuration. But I may be wrong. If so, please tell me why.
> 

Corrected in 4.1. Please upgrade.

Oleg



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


Re: HttpPost is being retried

Posted by Martin Ždila <m....@mwaysolutions.com>.
On Wed, Mar 9, 2011 at 3:02 PM, Razvan Mihailescu <
razvan.mihailescu@computaris.com> wrote:

> You may need to implement your own HttpRequestRetryHandler, as the one
> provided by default by http-client does a number of retries by default -
> DefaultHttpRequestRetryHandler.
> You will need to set the new retry handler property on your HttpClient. See
> AbstractHttpClient setHttpRequestRetryHandler method.
>

Thanks for your answer. I am aware that I can somehow configure it (now I
know I have to implement my own HttpRequestRetryHandler) but I would expect
that DefaultHttpClient works like standards say: not to retry POST method.
This should be default behavior of the DefaultHttpClient without any extra
configuration. But I may be wrong. If so, please tell me why.

Thanks :-)


> -----Original Message-----
> From: Martin Ždila [mailto:m.zdila@gmail.com]
> Sent: Wednesday, March 09, 2011 3:08 PM
> To: httpclient-users@hc.apache.org
> Subject: HttpPost is being retried
>
> Hello
>
> We are using HttpPost method with DefaultHttpClient. The server processing
> takes couple of minutes without any response during this time. I would
> expect the HttpPost execution to timeout because POST method is not
> repeatable. Instead it is repeated. Is this a bug?
>
> 9.3.2011 13:45:34 org.apache.http.impl.client.DefaultRequestDirector
> execute
> INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when
> processing request: The target server failed to respond
> 9.3.2011 13:45:34 org.apache.http.impl.client.DefaultRequestDirector
> execute
> INFO: Retrying request
> 9.3.2011 13:48:55 org.apache.http.impl.client.DefaultRequestDirector
> execute
> INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when
> processing request: The target server failed to respond
> 9.3.2011 13:48:55 org.apache.http.impl.client.DefaultRequestDirector
> execute
> INFO: Retrying request
> ... (loops forever)
>
> Thanks in advnce
> Best regards
> --
> Ing. Martin Ždila
> tel:+421-908-363-848
> mailto:martin@zdila.sk
> http://www.zdila.sk/
>
>
> This email is subject to Computaris email terms of use:
> http://www.computaris.com/email_terms
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>


-- 
Ing. Martin Ždila
CTO

M-Way Solutions Slovakia s.r.o.
Letná 27, 040 01 Košice
Slovakia

tel:+421-908-363-848
mailto:m.zdila@mwaysolutions.com
http://www.mwaysolutions.com