Skip to content

fix: Handler 订阅类型无法解析时不再订阅全部事件 (8.x/springboot-starter) - #229

Merged
xlorne merged 1 commit into
8.2.xfrom
feature/issue-228-handler-subscribe-8x
Nov 17, 2026
Merged

xlorne merged 1 commit into
8.2.xfrom
feature/issue-228-handler-subscribe-8x

Conversation

@xlorne

@xlorne xlorne commented Nov 17, 2026

Copy link
Copy Markdown
Contributor
  • ApplicationHandlerUtils 对 lambda / JDK 动态代理等无法解析泛型参数的 Handler, 不再退化为「订阅全部事件」,改为跳过并输出一次性告警,避免投递不相关事件后 抛出 ClassCastException;
  • 新增 removeHandlers,SpringDefaultEventHandler 实现 DisposableBean,在上下文 销毁时注销自己注册的 Handler 并关闭线程池,消除静态注册表跨上下文残留;
  • EventOrderE2ETest 的 Handler 改为具名类,补充订阅类型匹配与注销的回归测试;
  • 事件驱动规范补充 Handler 不得以 lambda 形式注册的说明。

Ref #228

Describe what this PR does / why we need it

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

- ApplicationHandlerUtils 对 lambda / JDK 动态代理等无法解析泛型参数的 Handler,
  不再退化为「订阅全部事件」,改为跳过并输出一次性告警,避免投递不相关事件后
  抛出 ClassCastException;
- 新增 removeHandlers,SpringDefaultEventHandler 实现 DisposableBean,在上下文
  销毁时注销自己注册的 Handler 并关闭线程池,消除静态注册表跨上下文残留;
- EventOrderE2ETest 的 Handler 改为具名类,补充订阅类型匹配与注销的回归测试;
- 事件驱动规范补充 Handler 不得以 lambda 形式注册的说明。

Ref #228
@xlorne
xlorne merged commit 0f28dd9 into 8.2.x Nov 17, 2026
1 check passed
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.30%. Comparing base (5078c4e) to head (79a080f).
⚠️ Report is 6 commits behind head on 8.2.x.

Files with missing lines Patch % Lines
...gboot/framework/event/ApplicationHandlerUtils.java 85.71% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              8.2.x     #229      +/-   ##
============================================
+ Coverage     87.20%   87.30%   +0.09%     
- Complexity     2357     2390      +33     
============================================
  Files           217      218       +1     
  Lines          6176     6253      +77     
  Branches        411      420       +9     
============================================
+ Hits           5386     5459      +73     
- Misses          643      644       +1     
- Partials        147      150       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant