Ken Krugler wrote:
Hi there,
I wanted to confirm that I'm handling stale connections appropriately,
so any input is appreciated.
I've got a test configuration where embedded Jetty is handling the HTTP
requests, and I've turned off stale connection checks on the client side.
I'm using httpcore-4.0.1 and httpclient-4.0-beta2. I know, the rc1
version of the client is available, but not via the Maven central repo.
First, I'm assuming that when I try to reuse a stale connection, what
I'll get is a SocketException. Not that I'm counting on this, but it's
the behavior I see with my test setup.
Ken,
Yes, this is correct.
Second, I really only want to retry the request when I get an
IOException. And that there's no point in retrying more than once.
I think the best way to do so is by providing a custom
HttpRequestRetryHandler. For details see:
http://hc.apache.org/httpcomponents-client/tutorial/html/fundamentals.html#d4e246
http://hc.apache.org/httpcomponents-client/tutorial/html/fundamentals.html#d4e280
Hope this helps
Oleg
Thanks,
-- Ken
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]