Java’s java.net.http.HttpClient finally speaks HTTP/3 — via JEP 517, completed for JDK 26.
🔸 TL;DR
▪️ JDK 26 adds HTTP/3 support to HttpClient with an opt-in flag.
▪️ You keep your code structure; you just select HTTP_3.
▪️ You still get graceful fallback when HTTP/3 isn’t available (unless you force it).
🔸 WHAT’S NEW (WITHOUT REWRITING YOUR CODE)
The big win: you can opt-in to HTTP/3 with minor changes — same HttpClient, same HttpRequest, same send() flow.
var client = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_3)
.build();
var request = HttpRequest.newBuilder(URI.create("https://openjdk.org/"))
.GET()
.build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
🔸 WHY HTTP/3 MATTERS
HTTP/3 runs over QUIC (UDP) and uses TLS 1.3, enabling:
▪️ potentially faster handshakes
▪️ better behavior under packet loss
▪️ avoiding “head-of-line blocking” issues tied to TCP congestion (a classic pain point at scale)
🔸 IMPORTANT: IT’S OPT-IN (DEFAULT STAYS HTTP/2)
Java won’t suddenly switch your apps to HTTP/3. HTTP/2 remains the default, and HTTP/3 is used only when you explicitly request it.
🔸 HOW IT NEGOTIATES IN REAL LIFE
Because you can’t reliably know upfront if a server supports HTTP/3, the client can:
▪️ try HTTP/3 first, then fall back to HTTP/2/1.1
▪️ race HTTP/3 and HTTP/2 in parallel (depending on where you set the preference)
▪️ discover HTTP/3 via Alt-Svc and upgrade on subsequent requests
▪️ or force “HTTP/3 only” (fail if not supported)
🔸 NON-GOALS (WHAT THIS IS NOT)
This is deliberately not a “QUIC programming API”, and it’s not an HTTP/3 server implementation.
▪️ no QUIC API exposure
▪️ no server-side HTTP/3 in the JDK
▪️ no third-party secure-socket providers support in the first implementation (first version focuses on the default provider)
🔸 GOTCHAS TO KEEP IN MIND
▪️ Some corporate networks/firewalls still treat UDP as “suspicious” → expect fallbacks.
▪️ HttpClient.Version gains a new enum value (HTTP_3) — watch out for switch statements that assumed only HTTP/1.1 + HTTP/2.
🔸 TAKEAWAYS
▪️ If you ship latency-sensitive apps (mobile, flaky networks, global users), HTTP/3 is now “1st-party Java”.
▪️ Start by enabling it on a dedicated client + measure (latency, retries, error rates).
▪️ Treat UDP availability as an environment constraint, not a guarantee.
#java #jdk26 #java26 #openjdk #jep517 #http3 #quic #tls13 #httpclient #performance #backend #cloudnative #networking
Go further with Java certification:
Java👇
Spring👇
SpringBook👇
JavaBook👇