{"id":16689549,"url":"https://github.com/sigpwned/aws-java-sdk-v2-java-11-client","last_synced_at":"2025-03-21T18:33:38.400Z","repository":{"id":218382588,"uuid":"746275520","full_name":"sigpwned/aws-java-sdk-v2-java-11-client","owner":"sigpwned","description":"An AWS Java SDK v2 HTTP Client implementation using Java 11 HttpClient","archived":false,"fork":false,"pushed_at":"2024-08-05T02:38:25.000Z","size":137,"stargazers_count":8,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T04:09:19.529Z","etag":null,"topics":["aws-java-sdk-v2","http-client","java-11-http-client"],"latest_commit_sha":null,"homepage":"https://github.com/sigpwned/aws-java-sdk-v2-java-11-client","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sigpwned.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-21T15:40:41.000Z","updated_at":"2025-02-18T19:14:41.000Z","dependencies_parsed_at":"2024-10-28T11:39:57.164Z","dependency_job_id":null,"html_url":"https://github.com/sigpwned/aws-java-sdk-v2-java-11-client","commit_stats":null,"previous_names":["sigpwned/aws-java-sdk-v2-java-nio-client","sigpwned/aws-java-sdk-v2-java-11-client"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Faws-java-sdk-v2-java-11-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Faws-java-sdk-v2-java-11-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Faws-java-sdk-v2-java-11-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Faws-java-sdk-v2-java-11-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sigpwned","download_url":"https://codeload.github.com/sigpwned/aws-java-sdk-v2-java-11-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244849746,"owners_count":20520779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-java-sdk-v2","http-client","java-11-http-client"],"created_at":"2024-10-12T15:48:33.031Z","updated_at":"2025-03-21T18:33:38.096Z","avatar_url":"https://github.com/sigpwned.png","language":"Java","readme":"# aws-java-sdk-v2-java-11-client [![tests](https://github.com/sigpwned/aws-java-sdk-v2-java-11-client/actions/workflows/integration.yml/badge.svg)](https://github.com/sigpwned/aws-java-sdk-v2-java-11-client/actions/workflows/integration.yml) ![Maven Central](https://img.shields.io/maven-central/v/com.sigpwned/awssdkv2-java11-async-client)\n\nAn implementation of the [AWS Java SDK v2 HTTP Client SPI](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/http-configuration.html) using [the Java 11 HttpClient](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html).\n\nIt was pulled from the [@aws/aws-java-sdk-v2](https://github.com/aws/aws-sdk-java-v2) [java-11-http-client](https://github.com/aws/aws-sdk-java-v2/tree/java-11-http-client) branch.\n\nIt is very much a work in progress. Help, feedback, and PRs are all welcome and (greatly) appreciated!\n\n## Getting started\n\nTo include the asynchronous client in your code, simply add the following Maven dependency:\n\n```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.sigpwned\u003c/groupId\u003e\n        \u003cartifactId\u003eawssdkv2-java11-async-client\u003c/artifactId\u003e\n        \u003cversion\u003e2.37.7.0-b0\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n## Background\n\nAWS Java SDK v2 has an [HTTP client service provider interface](https://central.sonatype.com/artifact/software.amazon.awssdk/http-client-spi), which it leverages to provide [a variety of managed HTTP clients](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/http-configuration.html) (e.g., [software.amazon.awssdk:url-connection-client](https://central.sonatype.com/artifact/software.amazon.awssdk/url-connection-client)). It would be usefult to have an additional AWS HTTP Client backed by the Java 11 HttpClient for a variety of reasons:\n\n* Reduced runtime size\n* Reduced cold start time\n* Simplified dependency management\n* Virtual Thread readiness\n\nSo far, Amazon itself seems [reluctant to provide such an implementation](https://github.com/aws/aws-sdk-java-v2/issues/1447#issuecomment-1902675971). And that's OK! Amazon has its own values, priorities, and resource constraints.\n\nBut they've also given us the tools to build such a client ourselves. This project is that implementation.\n\n## Implementations\n\nMore information about the \"official\" Amazon implementations is available [here](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/http-configuration.html).\n\nIntegration tests against live or mock services remain a work-in-progress.\n\n### Asynchronous\n\nThe `awssdkv2-java11-async-client` is an asynchronous implementation of the `SdkAsyncHttpClient` asynchronous HTTP client SPI from the AWS Java SDK v2. You can compare it to the two asynchronous clients Amazon currently supports for that library:\n\n* Netty [GitHub](https://github.com/aws/aws-sdk-java-v2/tree/master/http-clients/netty-nio-client) [Developer Guide](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/http-configuration-netty.html) [JavaDocs](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html)\n* AWS CRT [GitHub](https://github.com/aws/aws-sdk-java-v2/tree/master/http-clients/aws-crt-client) [Developer Guide](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/http-configuration-crt.html) [JavaDocs](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/crt/AwsCrtAsyncHttpClient.html)\n\nThis implementation can be used like any other implementation, for example for use in the SQS client:\n\n```java\n    SqsAsyncClient client = SqsAsyncClient.builder()\n        .httpClient(Java11AsyncHttpClient.create())\n        .region(Region.US_EAST_1)\n        .build();\n```\n\nThere are a few caveats about its usage as compared to other clients due to differences in the underlying `HttpClient` implementation:\n\n* There is no support for read and write timeouts, per [JDK-8258397](https://bugs.openjdk.org/browse/JDK-8258397). Rather, the client can be configured to use a request timeout, which limits how long the client waits until HTTP response headers are received, but that's it.\n* Proxy authentication is not supported out of the box. Per [JDK-8229962](https://bugs.openjdk.org/browse/JDK-8229962), configuring proxy authentication on `HttpClient` requires providing some process-level configuration parameters up front, so proxy authentication is [up to the user](https://stackoverflow.com/a/60170227/2103602), at least for now.\n* There is a difference in behavior for canceled HTTP requests between Java 11 and Java 15, and Java 16 and later. Per [JDK-8245462](https://bugs.openjdk.org/browse/JDK-8245462), before Java 16, calling `CompletableFuture#cancel(boolean)` on the result of `execute()` does nothing, whereas starting with Java 16 it now attempts to cancel the request in-flight.\n* The client does not close connections after receiving 5XX responses from the server, which is technically part of the requirements for other HTTP clients. The reason for the requirement is not documented, so it's not clear what negative effect(s) this difference will have in practice, if any.\n* There may be some slight differences in how `Expect: 100-continue`  is handled versus other clients.\n\n## Prior Art\n\nThere are some other implementations using this same approach that were very useful in creating this implementation:\n\n* [@gabfssilva/aws-spi-java-11](https://github.com/gabfssilva/aws-spi-java-11)\n* [@rmcsoft/j11_aws_http_client](https://github.com/rmcsoft/j11_aws_http_client)\n\nThey generally appear to be abandoned, which is why I created this project.\n\n## Help Wanted\n\nAll feedback -- even if it's just \"I tried it, and it worked\" -- is welcome, appreciated, and useful! Issues and PRs are even better.\n\nNaturally, all helpers will be added to the [contributors](https://github.com/sigpwned/aws-java-sdk-v2-java-nio-client/blob/main/CONTRIBUTORS.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigpwned%2Faws-java-sdk-v2-java-11-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigpwned%2Faws-java-sdk-v2-java-11-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigpwned%2Faws-java-sdk-v2-java-11-client/lists"}