-
Notifications
You must be signed in to change notification settings - Fork 920
Description
We're excited to announce the Developer Preview of Apache 5 HTTP Client for the AWS SDK for Java 2.x.
For more information, check our AWS Developer Tools Blog Post.
Supporting the Apache 5 HTTP client brings key improvements like compatibility with virtual threads in Java 21 and logging flexibility through SLF4J. Similar to our current Apache4-based client, this new client supports only synchronous operations.
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.32.0-PREVIEW</version>
</dependency>
Since it's a Developer Preview release, the version must have the -PREVIEW
suffix.
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();
Developer Preview
As a reminder, the Apache5 HTTP client is being released as a Developer Preview, so the goal is to gather feedback from early adopters and it can lead to redesigns and breaking changes, meaning it's not suitable for production environments.
Test it out today and let us know how the new client works for you, 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 or replying in the Github Discussion thread.