Skip to content

Conversation

@alzimmermsft
Copy link
Member

Description

Adds support for HTTP/2 in netty-http4 following the same concept in #45758, where ALPN is the only way for HTTP/2 to be used.

This design leverages HttpToHttp2ConnectionHandler and InboundHttp2ToHttpAdapter to convert HTTP/1.1 requests to HTTP/2 frames and HTTP/2 response frames to HTTP/1.1 objects. Initially, a more complex design where netty-http4 would 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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@alzimmermsft alzimmermsft self-assigned this Jun 23, 2025
Copilot AI review requested due to automatic review settings June 23, 2025 18:08
Copy link
Contributor

Copilot AI left a 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.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

io.clientcore:http-netty4

@alzimmermsft alzimmermsft merged commit b3dee91 into Azure:main Jun 27, 2025
17 checks passed
@alzimmermsft alzimmermsft deleted the AzCC_HttpNettyHttp2Support branch June 27, 2025 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants