Repository navigation
transport: support Jetty 12 with Spring Boot BOM precedence - #154
JingkaiTang wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## JDK17/Springboot3 #154 +/- ##
=============================================================
- Coverage 85.78765% 85.78352% -0.00414%
- Complexity 450 451 +1
=============================================================
Files 558 558
Lines 17330 17332 +2
Branches 1509 1509
=============================================================
+ Hits 14867 14868 +1
- Misses 2463 2464 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| <jetty.alpn.boot.version>8.1.13.v20181017</jetty.alpn.boot.version> | ||
| <jetty.version>11.0.25</jetty.version> | ||
| <jetty.version>12.1.14</jetty.version> | ||
| <joda-time.version>2.7</joda-time.version> |
There was a problem hiding this comment.
SpringBoot 3.5 实际管理的 12.0.x,jetty是不是用12.0.x。SpringBoot 4.x应该有下一个trpc版本兼容,trpc2.x不用兼容这个
There was a problem hiding this comment.
已在 3fcf823 把默认 Jetty 调整为 12.0.36,与 Spring Boot 3.5.16 管理的版本一致。这个 PR 的兼容范围收回到 Boot 3,Boot 4 留给后续版本处理。
| @@ -21,10 +21,9 @@ | |||
| import com.tencent.trpc.core.rpc.def.DefProviderInvoker; | |||
There was a problem hiding this comment.
HTTP/1.1 回退已改用 httpsConfig,与同一端口上的 HTTP/2 共用 HTTPS 配置。补了实际协商到 HTTP/1.1 的测试,确认 Servlet 读到的 scheme 是 https,isSecure() 为 true。
Host 校验这边保留了 Jetty 默认行为。确认过 setSniRequired(false) 不会关闭证书与请求 Host 的匹配检查,Jetty 11 也已有这项检查。这次补了证书与 Host 不匹配时返回 400 的用例。考虑到默认关闭会放宽现有校验,建议后续有明确的 IP 直连兼容需求时,再单独讨论配置开关。
| - name: Test with Maven | ||
| run: mvn clean install -Dmaven.test.skip=true -B -U --file pom.xml | ||
| - name: Test HTTP transport with Spring Boot BOM first | ||
| run: python3 trpc-transport/trpc-transport-http/src/test/it/boot-bom-first/run.py |
There was a problem hiding this comment.
用jetty 12.0.x这些测试是不是不需要了,trpc2.x版本不用考虑springboot4.x的问题
There was a problem hiding this comment.
已移除跨 Boot 版本的测试矩阵。这里保留了 Boot 3.5.16 BOM 优先的消费方回归,因为 #152 就是在应用先导入 Boot BOM、再导入 tRPC BOM 时触发的,仓库默认依赖顺序覆盖不到。JDK 17 下这组 14 项测试已全部通过。
| cache: maven | ||
| - name: Test with Maven | ||
| run: mvn clean install -Dmaven.test.skip=true -B -U --file pom.xml | ||
| - name: Test HTTP transport with Spring Boot BOM first |
There was a problem hiding this comment.
用jetty 12.0.x这些测试是不是不需要了,trpc2.x版本不用考虑springboot4.x的问题
There was a problem hiding this comment.
JDK 21 这边也已同步调整,只跑 Boot 3.5.16 BOM 优先这一组,14 项测试全部通过。

Fixes #152.
When a consumer imports Spring Boot's BOM before tRPC's BOM, Jetty 12 core artifacts are combined with the old Jetty 11 Servlet and HTTP/2 artifacts, causing HTTP server initialization to fail. Migrate the transport to Jetty 12 EE10 Servlet and renamed HTTP/2 artifacts, manage Jetty through its core and EE10 BOMs, and update the gateway WebApp dependency. The HttpExecutor contract, sessions and asynchronous Servlet responses are preserved.
The tRPC BOM now defaults to Jetty 12.0.36, matching Spring Boot 3.5.16. The framework's Spring Boot baseline remains 3.5.0. On the TLS connector, HTTP/2 and HTTP/1.1 now share the same HTTPS configuration, including Jetty's default Host/certificate check.
The JDK 17 and 21 CI jobs run the external HTTP transport regression with the Spring Boot 3.5.16 BOM imported before the tRPC BOM, reproducing the dependency order from #152.
Validation on Corretto 21.0.5