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

Upgrade to Jetty 12 #36073

Closed
wilkinsona opened this issue Jun 26, 2023 · 10 comments
Closed

Upgrade to Jetty 12 #36073

wilkinsona opened this issue Jun 26, 2023 · 10 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Jun 26, 2023

Work in progress is available in https://github.com/wilkinsona/spring-boot/tree/jetty-12. Related Jetty issues with 12.0.0.beta2:

@wilkinsona wilkinsona added type: enhancement A general enhancement status: blocked An issue that's blocked on an external project change labels Jun 26, 2023
@wilkinsona wilkinsona added this to the 3.x milestone Jun 26, 2023
@Sineaggi
Copy link

Sineaggi commented Aug 8, 2023

Jetty 12 has been released! 🎉 https://github.com/eclipse/jetty.project/releases/tag/jetty-12.0.0

@mikekuzak
Copy link

Hi,

Does the spring-boot-starter for Spring Boot 3 work now with Jetty 12 ?
I understand SP3 doesn't work with Jetty 11, because it's not supporting EE10 (Servlet 6.0)

@wilkinsona
Copy link
Member Author

Does the spring-boot-starter for Spring Boot 3 work now with Jetty 12 ?

No, not yet. There are a significant number of breaking API changes in Jetty 12 to which Spring Boot will have to adapt. We hope to support Jetty 12 in Spring Boot 3.2 and Spring Framework 6.1.

I understand SP3 doesn't work with Jetty 11, because it's not supporting EE10 (Servlet 6.0)

Spring Boot 3 works with Jetty 11 but you have to downgrade the Servlet API to 5.0. #33044 contains various ways to do that with both Maven and Gradle.

@joakime
Copy link

joakime commented Aug 9, 2023

Does the spring-boot-starter for Spring Boot 3 work now with Jetty 12 ?

No, not yet. There are a significant number of breaking API changes in Jetty 12 to which Spring Boot will have to adapt. We hope to support Jetty 12 in Spring Boot 3.2 and Spring Framework 6.1.

Is there an active branch with this effort where I can participate in?

@wilkinsona
Copy link
Member Author

Thanks, @joakime. spring-projects/spring-framework#30698 is the next piece in the puzzle. I don't know if there's an active branch for that work.

@lzysuqianqiu

This comment was marked as outdated.

@wilkinsona

This comment was marked as outdated.

@wilkinsona
Copy link
Member Author

spring-projects/spring-framework#30698 should land in Framework this week, allowing us to tackle this in 3.2.x.

@wilkinsona wilkinsona modified the milestones: 3.x, 3.2.x Sep 4, 2023
@kedaniilakis

This comment was marked as resolved.

@anbusampath

This comment was marked as resolved.

@wilkinsona wilkinsona removed the status: blocked An issue that's blocked on an external project change label Sep 7, 2023
@wilkinsona wilkinsona self-assigned this Sep 7, 2023
@wilkinsona wilkinsona modified the milestones: 3.2.x, 3.2.0-M3 Sep 7, 2023
ikhoon added a commit to line/armeria that referenced this issue Jan 25, 2024
Motivation:

Spring 6 HTTP client is split into two parts.
#4838 (comment) It
will be easier to review if Spring dependencies are upgraded before
working on Spring HTTP 6 integration.

Dependencies:
- Spring 6.0.13 -> 6.1.2
- Spring Boot 2.7.16 -> 2.7.18, 3.1.4 -> 3.2.1
- Jetty 12.0.5

Modifications:

- Spring Boot Actuator
- `@AutoConfigureMetrics` has been removed in favor of
`@AutoConfigureObservability`.
spring-projects/spring-boot#31308
- `@EnableTestMetrics` is added in Spring Boot 2 and 3 modules to share
the same test code.
- `@EnableTestMetrics` in `boot2-actuator-autoconfigure` inherits
`@AutoConfigureMetrics` but `@AutoConfigureObservability` is inherited
in `boot3-actuator-autoconfigure`.
- Spring Boot WebFlux
- `AbstractServerHttpRequestVersionSpecific` is added to shim the API
changes in Spring 6.1
- Some return types are wrapped in `Mono` in test REST APIs. Otherwise,
the service method is invoked with a blocking executor of Spring
WebFlux.
spring-projects/spring-framework@b016f38#diff-8fd6b8e3408492ba1cabbbea613ac33b7c674db0a9287a2d479e83ec55c1544eR253-R254
- Jetty 12
- Jetty version has been upgraded to 12 in Spring Boot 3.2.
spring-projects/spring-boot#36073
- Jetty core module is now independent of Servlet API.
https://webtide.com/introducing-jetty-12/
- Due to the change, the existing `JettyService` code can no longer be
reused, so `JettyService` is newly implemented based on the Jetty 12
API.
  - `JettyServiceBuilder`
- `JettyServiceBuilder.tlsReverseDnsLookup()` is removed because Jetty
`ServletApiRequest.getRemoteHost()` does not perform a reverse DNS
lookup.
- `JettyServiceBuilder.handlerWrapper(HandlerWrapper)` has been removed
in favor of `JettyServiceBuilder.insertHandler(Handler.Singleton)`
      - `HandlerWrapper` does not exist in Jetty 12.
- `insertHandler(Handler.Singleton)` is the most similar replacement.
- `JettyServiceBuilder.sessionIdManager(SessionIdManager)` and
`sessionIdManagerFactory(Function)` have been removed because
`Server.setSessionIdManager()` does not exist.
- Instead, `SessionIdManager` can be set via
`JettyServiceBuilder.bean()`
https://eclipse.dev/jetty/documentation/jetty-12/programming-guide/index.html#pg-server-session-idmgr
  - `JettyService`
- Jetty `Request` becomes immutable so Armeria request headers are
indirectly set via `HttpChannel.onRequest()`
- `HttpStreamOverHTTP1` provides a request body instead of
`HttpChannelOverHttp`.
- A response is now written to `HttpStreamOverHTTP1.send(...)`.
Previously, `HttpConnection.send(...)` was used.
- Failed to find the counterpart of `jReq.setDispatcherType()` and
`jReq.setAsyncSupported()`.
- Without `setAsyncSupported`, async could support via `Callback`
interface.
- `httpChannel.handle()` has been replaced with
`httpChannel.onRequest(requestMetadata).run()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

7 participants