[ISSUE #10622] [Enhancement] LiteEventDispatcher resolve ConsumerOffsetManager dynamically for better extensibility#10623
Merged
lizhimins merged 1 commit intoJul 17, 2026
Conversation
…eEventDispatcher - Remove cached consumerOffsetManager field from LiteEventDispatcher - Replace all usages with brokerController.getConsumerOffsetManager() for lazy resolution - Allows downstream projects to swap ConsumerOffsetManager after broker init
lizhimins
approved these changes
Jul 17, 2026
RockteMQ-AI
approved these changes
Jul 17, 2026
RockteMQ-AI
left a comment
Contributor
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Removes the cached ConsumerOffsetManager field in LiteEventDispatcher and resolves it dynamically via brokerController.getConsumerOffsetManager() at each call site, enabling downstream projects to swap in a custom implementation after broker initialization.
Findings
- [Info]
LiteEventDispatcher.java:227,271— The dynamic resolution adds a getter call on every dispatch iteration. SincegetConsumerOffsetManager()is a simple field accessor onBrokerController, the overhead is negligible. ✅ - [Info] The change is minimal (2 insertions, 5 deletions) and preserves existing behavior — only the resolution path changes. ✅
- [Info] Good extensibility improvement for downstream projects that customize
ConsumerOffsetManager.
Verdict
Clean, low-risk refactoring. LGTM.
Automated review by github-manager-bot
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10623 +/- ##
=============================================
- Coverage 48.35% 48.22% -0.13%
+ Complexity 13490 13456 -34
=============================================
Files 1380 1380
Lines 101009 101008 -1
Branches 13080 13080
=============================================
- Hits 48840 48711 -129
- Misses 46219 46320 +101
- Partials 5950 5977 +27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fuyou001
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Issue(s) This PR Fixes
Brief Description
Projects that build on top of this core may replace the
ConsumerOffsetManagerimplementation at the upper level. The dispatcher currently caches the manager as a final field at construction time, so the customized manager never takes effect.This PR resolves the manager lazily via
brokerController.getConsumerOffsetManager()instead of caching it in a field, allowing downstream projects to swap in their own implementation after the broker is fully initialized.How Did You Test This Change?
Existing unit tests cover the dispatcher logic. The change is minimal (2 insertions, 5 deletions) and does not alter behavior — only the resolution path.