Skip to content
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

Jetty 12 support in WebFlux #29575

Closed
jhoeller opened this issue Nov 25, 2022 · 2 comments
Closed

Jetty 12 support in WebFlux #29575

jhoeller opened this issue Nov 25, 2022 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@jhoeller
Copy link
Contributor

jhoeller commented Nov 25, 2022

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(), with Request/Response themselves being interfaces instead of classes now (not binary compatible): API compatibility between Jetty 11 and 12: org.eclipse.jetty.server.Request/Response#getHeaders() jetty/jetty.project#8938
  • Additionally, HttpFields.Mutable has been changed from a class to an interface as well, making our JettyHeadersAdapter 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 of HttpOutput 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

@jhoeller jhoeller added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Nov 25, 2022
@jhoeller jhoeller added this to the 6.0.x milestone Nov 25, 2022
@jhoeller jhoeller self-assigned this Nov 25, 2022
jhoeller added a commit that referenced this issue Nov 25, 2022
Reflective getHeaders calls to be revisited; see GitHub issue #8938 in Jetty project.
HttpOutput optimization commented out still in order to avoid alpha build dependency.

See gh-29575
@jhoeller
Copy link
Contributor Author

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).

jhoeller added a commit that referenced this issue Dec 1, 2022
Avoids HttpFields optimization completely, relying on Servlet header access instead.
ServletServerHttpResponse provides applyHeaders/adaptHeaders split for better reuse.

See gh-29575
@jhoeller
Copy link
Contributor Author

jhoeller commented Dec 1, 2022

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.

@jhoeller jhoeller modified the milestones: 6.0.x, 6.0.6 Feb 1, 2023
@jhoeller jhoeller modified the milestones: 6.0.6, 6.0.7 Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant