[ISSUE #10895] Validate every Lite consumer subscription against its bound topic - #10918
Conversation
…t its bound topic
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
This PR fixes a bug in ClientProcessor.validateLiteSubTopic() where only the first subscription's bindTopic was validated. The fix iterates over all subscriptions in the set, ensuring each one is validated.
The original code used subList.iterator().next().getTopic() which only checked the first element — a clear bug when multiple subscriptions exist.
LGTM. Correct fix.
Note: This PR also includes changes from #10914-#10917. See the series overlap comment on those PRs.
Automated review by github-manager-bot
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review Summary
This PR fixes incomplete validation in ClientProcessor where only the first Lite consumer subscription was being validated against its bound topic.
Findings
- [Critical] ClientProcessor.java — The original code only validated the first subscription in the list, leaving subsequent subscriptions unchecked. This could allow invalid subscriptions to bypass validation.
- [Info] The fix correctly iterates through all subscriptions and validates each one.
Overall
Good fix for incomplete validation. Ensures all Lite consumer subscriptions are properly validated against their bound topics.
Automated review by RockteMQ-AI
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Fixes incomplete validation in ClientProcessor where only the first Lite consumer subscription was validated against its bound topic. Now iterates over all subscriptions in the set.
Correct fix for the validation gap. LGTM.
Automated review by github-manager-bot
What is the purpose of the change
Fix #10895.
ClientProcessor.validateLiteSubTopic validated only subList.iterator().next(), so a Lite consumer group could include a subscription for a different topic as long as the first set element matched the bound topic.
Brief changelog
How was this patch verified
git diff --checkclean