Repository navigation
transport: support Jetty 12 with Spring Boot BOM precedence - #154
wardseptember merged 3 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.77198% -0.01568%
Complexity 450 450
=============================================================
Files 558 558
Lines 17330 17332 +2
Branches 1509 1509
=============================================================
- Hits 14867 14866 -1
- Misses 2463 2466 +3
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 项测试全部通过。
| - name: Test HTTP transport with Spring Boot 3.5.16 BOM first | ||
| run: mvn -B -ntp -f trpc-transport/trpc-transport-http/src/test/it/boot-bom-first/pom.xml test |
There was a problem hiding this comment.
这两行是不是可以删了,版本一样了,是不是不用测了?还有下面的两行
There was a problem hiding this comment.
已在 4bfe681 删除 JDK 17 和 21 下单独运行 Boot 3.5.16 BOM 回归的步骤。现在 ci.yml 已与目标分支一致,两个 JDK 的常规 PR 测试均已通过。
| @@ -0,0 +1,100 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
There was a problem hiding this comment.
trpc-transport/trpc-transport-http/src/test/it 这个目录也帮删掉?其他的应该没啥问题了
There was a problem hiding this comment.
已删除 trpc-transport/trpc-transport-http/src/test/it 目录,并同步更新了 PR 描述。之前验证 Boot BOM 优先导入的 CI 记录已附在描述里,方便后续查阅。HTTP/1.1 回退和 Host 校验仍由模块常规测试覆盖。

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 regular JDK 17 and 21 PR builds run the HTTP transport tests.
Validation on Corretto 21.0.5
3fcf823, the default transport and a consumer importing the Spring Boot 3.5.16 BOM first both resolved Jetty 12.0.36. The consumer passed all 14 tests on JDK 17 and JDK 21.