Class SdkConnectionReuseStrategy

java.lang.Object
org.apache.http.impl.DefaultConnectionReuseStrategy
org.apache.http.impl.client.DefaultClientConnectionReuseStrategy
software.amazon.awssdk.http.apache.internal.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.

  • Field Summary

    Fields inherited from class org.apache.http.impl.client.DefaultClientConnectionReuseStrategy

    INSTANCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    keepAlive(org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SdkConnectionReuseStrategy

      public SdkConnectionReuseStrategy()
  • Method Details

    • 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