-
Notifications
You must be signed in to change notification settings - Fork 974
Description
We're excited to announce the General Availability of the new Apache 5 HTTP Client for the AWS SDK for Java 2.x.
Released in Java SDK v2.41.0, this new Apache HttpClient 5.x-based client brings key improvements like:
- Modern Java ecosystem compatibility with virtual thread support for Java 21
- Active maintenance with regular security updates
- Enhanced logging flexibility through SLF4J
Getting Started
To get started, first add the new apache5-client dependency to your project:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache5-client</artifactId>
<version>2.41.0</version>
</dependency>Then, configure any AWS service client to use the new AWS SDK Apache 5 HTTP client:
S3Client s3Client = S3Client.builder()
.httpClient(Apache5HttpClient.create())
.build();If you wish to customize the settings, you can use the Apache5HttpClient.builder:
Apache5HttpClient httpClient = Apache5HttpClient.builder()
.connectionTimeout(Duration.ofSeconds(30))
.maxConnections(100)
.build();
DynamoDbClient dynamoDbClient = DynamoDbClient.builder()
.httpClient(httpClient)
.build(); Migrate from Apache 4.5.x
If you’re currently using the default Apache HTTP Client (4.5.x), migration is straightforward – add the new dependency and update your client configuration with an Apache 5 HTTP client as shown above. The API remains consistent with other HTTP client implementations in the SDK. Note that like the existing Apache 4.5.x HTTP client, this implementation supports synchronous service clients only.
Feedback
We'd love to hear your feedback. If you have questions, find a bug or have a feature request for the client to better suit your needs, please reach out to us by creating a GitHub issue.