-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
API compatibility between Jetty 11 and 12: org.eclipse.jetty.server.Request/Response#getHeaders() #8938
Comments
@jhoeller we can certainly introduce Can you point out what Spring code exactly you refer to, so we can take a look as well and perhaps suggest alternatives, if any? |
@sbordet that would be all we need indeed, on both Concretely, this is about the |
@jhoeller I gave this a try, but I don't think it will work if I understand correctly your comment. Even providing the
You would have to recompile Spring against Jetty 12, or rely on reflection in both cases (you have a single reflection on Just to state our ideal setup in a near future, we would like -- if possible -- Spring 6.1.x to depend on Jetty 12 only, once Jetty 12 is out in stable versions. For Spring 6.0.x I understand that you support both Jetty 11 and Jetty 12 via Servlet APIs, which is fine, but unfortunately requires reflection due to the API incompatibilities. Also, writing to the I will prepare a PR to add Let us know what you think about dropping support for Jetty 11 in a near-future Spring version. |
… for Spring. Introduced Request.getHeaders() and Response.getHeaders(). Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Oh, thanks for pointing that out! I only recompiled against Jetty 12, have not actually tried compiling on 11 and running against 12 yet. If We could rather easily keep up Jetty 11 support for plain Servlet purposes with Spring MVC/WebSocket in 6.1 (since we do not need Jetty 12 specific APIs there), while at the same time requiring Jetty 12+ for embedded HTTP engine purposes in WebFlux. So we would not drop Jetty 11 support completely but rather just drop support for using Jetty 11 as an embedded engine in our reactive web stacks, for the benefit of deeper integration with the Jetty 12 core. In the meantime, we are considering basic Jetty 12 support in Spring Boot 3.1 (May 2023), based on Spring Framework 6.0.x still. Is there a chance of Jetty 12 going final in that timeframe? If not, we might ship such early support as a preview only, before jumping to Jetty 12 in Spring Boot 3.2 / Framework 6.1 (November 2023). |
Looking at this more closely, it seems straightforward enough to address early Jetty 12 compatibility for our purposes since The only other concern is unwrapping a given Overall, for an early Jetty 12 compatibility arrangement (within the Servlet based adapter in WebFlux) while retaining a Jetty 11 baseline, this is probably good enough for Spring Framework 6.0.x. So we can close this Beyond that, for a tighter Jetty 12 based engine in WebFlux, we would not build on the Servlet-derived |
Our goal is betas in December/January, and final in February/March. Integration with Spring Boot would be interesting indeed, and one more use case for us to validate Jetty 12. Note that Jetty 12 will be able to do "core" (meaning no Servlet dependencies), EE9 and EE10, so you will be able to retain the Jetty Servlet integration if you want, but also offer a more performant "core" alternative.
Thanks for pointing that out, we will fix it to
Agreed. I'll drop #8941 then. Please reach out for any issue or help with the integration in Spring Boot. Thanks! |
This issue has been automatically marked as stale because it has been a |
Closing as Spring 6.1 and Spring Boot 3.1 have now support for Jetty 12. |
For Spring Framework 6.0's core Jetty integration in WebFlux, we interact with
org.eclipse.jetty.server.Request#getHttpFields()
andorg.eclipse.jetty.server.Response#getHttpFields()
in Jetty 11 which changed to#getHeaders()
in Jetty 12.Trying to avoid reflection for supporting both versions of Jetty, is there any chance you could keep providing
#getHttpFields()
in Jetty 12 (in deprecated form) or alternatively - even preferably? - introduce#getHeaders()
in a Jetty 11.0.x release as well, allowing integrators like Spring to have a single method to call between Jetty 11.0.x and 12 there?The text was updated successfully, but these errors were encountered: