Jetty 12 is currently in alpha but expected to enter its beta phase soon, as the first generation of Jetty to provide Servlet 6.0 (Jakarta EE 10) support.
While Spring MVC should be naturally compatible with it as a Servlet 6.0 container and the standard Jakarta WebSocket upgrade strategy (also from EE 10) should kick in for WebSocket request upgrades without specific changes on Spring's side, explicit adaptations will be necessary for Jetty 12 in core WebFlux:
org.eclipse.jetty.server.Request/Response#getHttpFields()
has been changed to#getHeaders()
, withRequest/Response
themselves being interfaces instead of classes now (not binary compatible): https://github.com/eclipse/jetty.project/issues/8938- Additionally,
HttpFields.Mutable
has been changed from a class to an interface as well, making ourJettyHeadersAdapter
binary incompatible with it. Given the amount of reflection required here, it seems better to avoid the HttpFields optimization completely and rely on Servlet header access instead. HttpOutput.write(ByteBuffer)
has been relocated to a different package. We can support both variants ofHttpOutput
in their different locations side by side through compiling against the Jetty 11 BOM plus the Jetty 12 EE 10 Servlet artifact.
Beyond that, our JettyWebSocketClient
variants are tied to Jetty 11. They would have to work with a relocated API in Jetty 12, even in EE-version-specific jetty.ee10.websocket.client
packages. Since they are superseded by the Jakarta WebSocket based StandardWebSocketClient
already, we intend to deprecate them in 6.0.3 and never upgrade them for Jetty 12 to begin with: #29576
Comment From: jhoeller
Early support for Jetty 12 is available in 6.0.3 snapshots now, along with the JettyWebSocketClient
deprecation in #29576. This includes a reflective adaptation to getHeaders()
which we intend to revisit based on the Jetty project issue above, as well as a commented-out optimization based on the Jetty 12 HttpOutput
variant (to be applied once Jetty 12 beta artifacts are available).
Comment From: jhoeller
Revised support for Jetty is available in 6.0.3 snapshots now, tested against Jetty 12.0.0.alpha2. This avoids the HttpFields
optimization completely now, relying on Servlet header access instead. Support for the Jetty 12 HttpOutput
variant remains commented out for the time being, waiting for Jetty 12 beta artifacts to be released.