跪拜 Guibai
← All articles
Java · HTTP3 · Netty

Java 26 Ships Native HTTP/3, Kills the Netty Dependency for QUIC

By GitLqr ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Removing the Netty dependency for QUIC shrinks deployment footprints and simplifies the dependency tree for any Java service that wants HTTP/3's head-of-line blocking fix. Combined with virtual threads, the standard library now handles high-concurrency networking without third-party baggage.

Summary

Java 26 ships with native HTTP/3 support in the standard HttpClient, ending the long-standing requirement to pull in Netty or Vert.x just to speak QUIC. Developers can now enable the protocol by setting HttpClient.Version.HTTP_3, with the JVM handling UDP connections directly. The implementation includes automatic fallback to HTTP/2 or HTTP/1.1 when UDP is blocked by a firewall, plus native Alt-Svc header parsing for seamless protocol upgrades on subsequent requests. For internal microservices on controlled networks, a strict mode forces HTTP/3-only connections and fails fast if QUIC is unavailable, skipping the fallback overhead entirely.

Takeaways
Java 26's HttpClient gains native HTTP/3 support through JEP 517, using QUIC over UDP directly.
Enabling HTTP/3 requires explicitly setting HttpClient.Version.HTTP_3; the default remains HTTP/2.
Automatic fallback to HTTP/2 or HTTP/1.1 occurs when UDP is blocked by firewalls or unsupported by the server.
Native Alt-Svc header parsing lets the JVM switch to QUIC on subsequent requests after a server advertises HTTP/3 support.
A strict mode via Http3DiscoveryMode.HTTP_3_URI_ONLY forces HTTP/3-only connections and fails immediately if QUIC is unavailable.
Conclusions

Baking QUIC into the standard library shifts HTTP/3 from a specialized, library-dependent feature to a trivial configuration flag, which lowers the barrier for widespread adoption across the Java ecosystem.

The fallback design acknowledges that UDP still faces real-world routing problems, so the JVM treats HTTP/3 as an opportunistic upgrade rather than a hard requirement—a pragmatic choice that avoids breaking existing deployments.

Strict mode targets internal microservices where network paths are controlled, suggesting the JDK team sees HTTP/3's value not just for public internet traffic but for reducing tail latency inside data centers.

Concepts & terms
QUIC
A transport protocol built on UDP that eliminates TCP head-of-line blocking by carrying multiple independent streams within a single connection, so packet loss on one stream doesn't stall the others.
Alt-Svc (Alternative Service)
An HTTP response header that tells a client the same service is available over a different protocol or endpoint, enabling an HTTP/2 server to advertise HTTP/3 support for future requests.
Head-of-Line Blocking
A performance problem in TCP where a lost packet delays all subsequent packets in the same connection, even if they belong to unrelated streams. HTTP/3 fixes this by using QUIC over UDP.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗