Class SdkConnectionReuseStrategy

  • All Implemented Interfaces:
    org.apache.http.ConnectionReuseStrategy

    public class SdkConnectionReuseStrategy
    extends org.apache.http.impl.client.DefaultClientConnectionReuseStrategy
    Do not reuse connections that returned a 5xx error.

    This is not strictly the behavior we would want in an AWS client, because sometimes we might want to keep a connection open (e.g. an undocumented service's 503 'SlowDown') and sometimes we might want to close the connection (e.g. S3's 400 RequestTimeout or Glacier's 408 RequestTimeoutException), but this is good enough for the majority of services, and the ones for which it is not should not be impacted too harshly.

    • Constructor Detail

      • SdkConnectionReuseStrategy

        public SdkConnectionReuseStrategy()
    • Method Detail

      • keepAlive

        public boolean keepAlive​(org.apache.http.HttpResponse response,
                                 org.apache.http.protocol.HttpContext context)
        Specified by:
        keepAlive in interface org.apache.http.ConnectionReuseStrategy
        Overrides:
        keepAlive in class org.apache.http.impl.client.DefaultClientConnectionReuseStrategy