-
Notifications
You must be signed in to change notification settings - Fork 38.1k
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
Add an Eclipse Jetty Core HttpHandlerAdaptor #32035
Comments
Work has commenced on this enhancement at: webtide#1 |
HttpHandlerAdaptor
Hi Greg, Thanks for that suggestion and the initial work! This looks sensible indeed for providing even closer Jetty 12 integration. And since Jetty's Servlet adapters live entirely outside of the core in version-specific packages and modules now, it is also attractive from our maintenance perspective to not involve those modules in WebFlux anymore. In terms of our timeline, this would be a great fit with our 6.2 for which we intend to do the first milestone in May, leading up to general availability in November. We are happy to review and test the current prototype ASAP, and once this shapes up into a PR, to merge it into the mainline for inclusion in 6.2 M1. |
@jhoeller currently we are implementing it as an alternative to the Jetty Servlet adaptor, as I'm not clear if there are ways to surface the underlying servlet request/response in spring applications or not?? Would it be reasonable to keep the servlet based adaptor as a deprecated for a release or two? That timeline sounds good... I'd like to think we'd be ready before that... but January is almost over already! |
In WebFlux, the Servlet request/response does not leak through to the application at all, so migrating from the Servlet-based adapter to the Jetty Core adapter should be entirely transparent to WebFlux users in a Spring Boot auto-configuration context. We could suggest a switch to the Jetty Core adapter by default for Spring Boot 3.4 (GA in November). So whenever someone indicates Jetty for WebFlux then, they would simply get the Jetty Core adapter as of Boot 3.4, just like they got the Jetty 11->12 upgrade with Boot 3.2 a few months ago. I see no need to make this an explicit choice for Spring Boot users, rather treating it as an internal upgrade as of a particular Boot release. Do you see any downside to the Jetty Core adapter (in a matured state)? Keeping the Servlet-based adapter around for programmatic setups seems sensible in Spring Framework 6.2 but we'd probably drop it entirely as of 7.0. |
@jhoeller I've labelled the jetty |
@gregw a general non-blocking label should be fine there since this is exclusively for WebFlux as a reactive stack. Any kind of blocking in that stack would be a mistake unless it got scheduled on a different dispatcher. In any case, not a scenario the HttpHandler has to deal with. |
@jhoeller FYI we are making good progress. However, we are failing two tests that undertow is also failing (and currently excludes). See #25310. |
@jhoeller I'm trying to square your response here with the comment in jetty/jetty.project#11342 (comment) that suggests a springboot integration has been done by extending If we remove the servlet based jetty integration, will that prevent applications from using Servlet if they need to? |
@gregw I suppose the user who reported that Jetty issue uses Spring MVC on a Servlet stack, or even a custom Servlet arrangement on a similar stack, but not WebFlux. There is a duality between Servlet-based stacks with Spring MVC or similar Servlets, with the Servlet API being a user-visible concern - as opposed to Spring WebFlux (our reactive web stack) which is entirely self-contained, with Servlet adaptation being an internal detail that does not leak through. Even with a rewritten Jetty adapter underneath Spring WebFlux, people can always choose to use a Servlet stack instead, deploying either a In any case, the HttpHandler in the works here only needs to cover Spring WebFlux (where the Servlet API does not leak through). It won't be in use for a regular Spring MVC stack (where the Servlet API is user-visible) at all since such a Servlet stack will be deployed in a traditional fashion instead. |
HttpHandlerAdaptor
Superseded by PR #32097. |
Affects: >= 6.1.4
The current Jetty integration uses the Servlet abstraction, which is primarily blocking and has additional buffering layers.
The jetty core server (added in jetty-12) has a reactive style asynchronous API very compatible with
Flux<DataBuffer>
style programming. A simpler and more efficient integration can thus be created by avoiding Servlets and going direct to jetty core.The text was updated successfully, but these errors were encountered: