Announcement: Apache 5 is now the default HTTP Client #7008
debora-ito
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Starting in Java SDK
v2.46.0, SDK sync clients will use Apache 5 as the default HTTP client, without the need to manually addapache5-clientas a dependency. This change comes after support for Apache 5 was added inv2.41.0.Simply add the service module to your project, and the sync client will use Apache 5 HTTP client by default:
If you want to customize the client settings, use the Apache5HttpClient.builder() as before:
Notable changes
apache-client, after this change theapache5-clientwill be also added to the classpath, resulting in a ~2.3 MB increase in bundled artifact size. To avoid the jar size increase you can exclude theapache5-clientas a workaround:Note that we recommend to fully migrate to use
apache5-clientinstead ofapache-client.expectContinueEnabledconfiguration to True:TCP_KEEPIDLE,TCP_KEEPINTERVAL,TCP_KEEPCOUNT), which requirejdk.net.NetworkPermissionwhen a SecurityManager is active. Without these permissions, requests fail withjava.security.AccessControlException: access denied. These permissions were not required for Apache 4.x. If you use SecurityManager and start to seeAccessControlExceptionsafter the upgrade, you need to grant permission to those TCP keep-alive options, see PR #6974 for details.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 new GitHub issue.
Beta Was this translation helpful? Give feedback.
All reactions