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: Am I doing this right: PoolingHttpClientConnectionManager
Date Sun, 11 Oct 2015 08:46:41 GMT
On Sat, 2015-10-10 at 17:21 -0700, Vic Cekvenich wrote:
> Hi, we have heavy load, am I using the pool right:
> 
> 1. I make a call using a client and in finally I consume but * don't * call
> close() - since I want conn returned to the pool.
> 

You really _should_ close the response from a try-finally or
try-with-resources

> 2. In HttpRequestRetryHandler retryRequest, once it retries 10 times, I do
> close the conn - since it should be removed from the pool as likely bad.
> 

HttpClient automatically closes and evicts faulty connections. 

> HttpClientContext ctx = (HttpClientContext) context;
> HttpClientConnection conn = (HttpClientConnection) ctx.getConnection();
> conn.close();
> This I do since I get many close max tries errors and other error responses
> from the end point
> 
> I get socket closed errors.
> 
> What should I do in retryRequest after 20 errors to reduce further errors?
> 

Return false.

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