-
Notifications
You must be signed in to change notification settings - Fork 2.1k
HTTP/2 in netty-http4 #45793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP/2 in netty-http4 #45793
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for HTTP/2 in netty-http4 by leveraging ALPN and reusing HTTP/1.1 conversion mechanisms. Key changes include the introduction of an isHttp2 flag across several HTTP handlers and streams, renaming of HTTP headers wrappers (e.g. from WrappedHttpHeaders to WrappedHttp11Headers), and adjustments in the client builder to support HTTP/2.
Reviewed Changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/parents/clientcore-parent/pom.xml | Adds a javaagent argument for TLS secret extraction. |
| sdk/clientcore/http-netty4/src/test/java/io/clientcore/http/netty4/implementation/* | Updates test classes and renames classes to reflect HTTP/1.1 specificity. |
| sdk/clientcore/http-netty4/src/main/java/io/clientcore/http/netty4/implementation/* | Introduces the isHttp2 flag in various handlers, streams, and binary data classes, and renames HTTP headers wrappers. |
| sdk/clientcore/http-netty4/src/main/java/io/clientcore/http/netty4/NettyHttpClientBuilder.java and NettyHttpClient.java | Modifies builder settings and client initialization to support HTTP/2. |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Description
Adds support for HTTP/2 in
netty-http4following the same concept in #45758, where ALPN is the only way for HTTP/2 to be used.This design leverages
HttpToHttp2ConnectionHandlerandInboundHttp2ToHttpAdapterto convert HTTP/1.1 requests to HTTP/2 frames and HTTP/2 response frames to HTTP/1.1 objects. Initially, a more complex design wherenetty-http4would handle HTTP/2 request and response frames with a complete separate code path from HTTP/1.1 was tests, but a few issues were found so the simpler design was chosen. In the future, if performance is lacking, that previous design can be retried to provide a higher level of performance and the current design performs a lot of transformations.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines