Class Apache5HttpClient

  • All Implemented Interfaces:
    AutoCloseable, SdkHttpClient, SdkAutoCloseable

    public final class Apache5HttpClient
    extends Object
    implements SdkHttpClient
    An implementation of SdkHttpClient that uses Apache HttpClient 5.x to communicate with the service. This is a full-featured synchronous client that adds an extra dependency and higher startup latency compared to UrlConnectionHttpClient in exchange for more functionality, like support for HTTP proxies.

    This client uses Apache HttpClient 5.x, which provides the following improvements over the Apache HttpClient 4.5.x based client:

    • Modern Java ecosystem compatibility including virtual thread support for Java 21
    • Active maintenance with regular security updates
    • Enhanced logging flexibility through SLF4J (replacing problematic JCL dependencies)

    Note: Performance characteristics between Apache 4.5.x and 5.x clients are similar.

    See UrlConnectionHttpClient for a lighter-weight alternative implementation.

    This can be created via builder()