users@jersey.java.net

[Jersey] Custom retry handler with Apache HTTP client?

From: Jeff <predatorvi_at_gmail.com>
Date: Fri, 17 Feb 2017 12:25:40 -0700

*Short Version:*
Is it possible to configure a custom request retry handler when using the
ApacheConnectorProvider + PoolingHttpClientConnectionManager?


*Long Version:*
I'm a bit of a n00b with Jersey. I'm using Jersey 2.25.1 and I've recently
switched from using the default HTTP connection mechanism to the Apache
PoolingHttpClientConnectionManager to improve the scaling ability of my
automated test framework.

It is generally working, but as I scale, I get the odd 'connect timeout'.
Rather than cranking the timeouts up, I'd like to adjust the way the Apache
HTTP client handles retries.

I believe that the Apache HTTPClient has the ability to accept a custom
retry handler, but I don't know how to install the custom handler with
Jersey. I can't find any examples in my many search attempts.

Any guidance is much appreciated!

-Jeff