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: How to close the underlying connection within callback?
Date Wed, 29 Jul 2015 10:28:16 GMT
On Tue, 2015-07-28 at 19:06 +0530, Shushant Arora wrote:
> Does this problem comes in PoolingNHttpClientConnectionManager  also or
> pooling manager handles this automatically without user being rethrow the
> exception from failed callback method of
> FutureCallback .
> 
> And is it safe to retry the request from failed callback .
>  some sort of
> 
> future = httpclient.execute(request1,new
> AsyncHttpCallbackHandler(closeableHttpAsyncClient,request, currentRetry,
> maxRetry));
> 
> class AsyncHttpCallbackHandler implements FutureCallback<HttpResponse>{
> 
> public void failed(Exception ex) {
> //retry check and retry the request
>   closeableHttpAsyncClient.execute(request,this);
> }
> }
> 

It might be safe but would rather avoid doing that. I would probably use
a queue for all outgoing request and would re-introduce failed request
back to the queue for re-execution.

Oleg



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


Mime
View raw message