hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vic Cekvenich <cekvenich....@gmail.com>
Subject Re: Am I doing this right: PoolingHttpClientConnectionManager
Date Sun, 11 Oct 2015 22:13:49 GMT
Hi Oleg, Thx.
Is there a way to manually mark a connection as 'stale' or anything such

This would force use of another connection in the pool or establishing a
new one.
Vic


On Sun, Oct 11, 2015 at 1:46 AM, Oleg Kalnichevski <olegk@apache.org> wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message