Skip to content

transport: support Jetty 12 with Spring Boot BOM precedence - #154

Open
JingkaiTang wants to merge 1 commit into
trpc-group:JDK17/Springboot3from
JingkaiTang:fix/jetty12-http-transport
Open

JingkaiTang wants to merge 1 commit into
trpc-group:JDK17/Springboot3from
JingkaiTang:fix/jetty12-http-transport

Conversation

@JingkaiTang

@JingkaiTang JingkaiTang commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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 default Jetty version is 12.1.14; the Spring Boot baseline remains 3.5.0. Boot 3.x manages both core and EE10 versions. Boot 4 manages EE11 instead of EE10, so a 12.1-compatible EE10 default is needed when its BOM takes precedence.

Add an external consumer regression with Boot's BOM first and run it in the JDK 17/21 CI jobs. The matrix covers every stable patch of the current Boot minor line and later stable releases, plus the latest patch of the two preceding minor lines. This validates HTTP transport/BOM compatibility, not complete Boot 4 starter or gateway application support.

Validation on Corretto 21.0.5:

  • 32 Boot BOM combinations (3.3.13, 3.4.13, 3.5.0–3.5.16, 4.0.0–4.0.9, 4.1.0–4.1.2): 13 tests each, 416 executions passed with no skips.
  • Default Jetty 12.1.14 transport: 13 tests passed, including HTTP, HTTPS, h2c, h2/ALPN, POST bodies and async responses.
  • HTTP protocol RPC regression: final run 74 tests passed. The first run hit one existing 2000 ms test deadline; the individual case and full rerun passed without changing code, deadlines or assertions. The initial timeout's cause remains undetermined.
  • Gateway reactor compile and changed Java Checkstyle passed.

Upstream CI passed on the exact PR head: Maven install and Boot BOM matrix passed on JDK 17 and 21 (32 combinations / 416 test executions per JDK); PR regression tests passed on both JDKs, and Checkstyle passed.

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.69121%. Comparing base (221d755) to head (1fc786b).

Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                      @@
##             JDK17/Springboot3        #154         +/-   ##
=============================================================
- Coverage             85.78765%   85.69121%   -0.09645%     
+ Complexity                 450         446          -4     
=============================================================
  Files                      558         558                 
  Lines                    17330       17332          +2     
  Branches                  1509        1509                 
=============================================================
- Hits                     14867       14852         -15     
- Misses                    2463        2480         +17     
Flag Coverage Δ
Merge ?
pull-request 85.69121% <100.00000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../transport/http/support/jetty/JettyHttpServer.java 92.30769% <100.00000%> (+0.30768%) ⬆️

... and 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

<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>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpringBoot 3.5 实际管理的 12.0.x,jetty是不是用12.0.x。SpringBoot 4.x应该有下一个trpc版本兼容,trpc2.x不用兼容这个

@@ -21,10 +21,9 @@
import com.tencent.trpc.core.rpc.def.DefProviderInvoker;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image 这两个问题帮改一下?

Comment thread .github/workflows/ci.yml
- 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用jetty 12.0.x这些测试是不是不需要了,trpc2.x版本不用考虑springboot4.x的问题

Comment thread .github/workflows/ci.yml
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用jetty 12.0.x这些测试是不是不需要了,trpc2.x版本不用考虑springboot4.x的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants