Skip to content

fix: validate every Lite consumer subscription against its bound topic [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #10902

Open
waterWang wants to merge 2 commits into
apache:developfrom
waterWang:fix/validate-all-lite-subscriptions
Open

fix: validate every Lite consumer subscription against its bound topic [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]#10902
waterWang wants to merge 2 commits into
apache:developfrom
waterWang:fix/validate-all-lite-subscriptions

Conversation

@waterWang

Copy link
Copy Markdown

What

ClientProcessor.validateLiteSubTopic now validates every subscription in the set against the group's bound topic, not just the first element.

Why

ClientProcessor.validateLiteSubTopic called subList.iterator().next().getTopic(), which only checks the first element of the subscription set. A Lite consumer group with a configured liteBindTopic could include a second subscription for a different topic without being rejected.

How

  • Changed the single-element check to a for loop over all elements
  • Added testValidateLiteSubTopic_mismatchedSecondTopic_throwsException to verify that a mismatching second subscription triggers ILLEGAL_TOPIC

Fixes #10895

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary

Fixes a validation bypass in ClientProcessor.validateLiteSubTopic where only the first subscription in the set was checked against the bound topic. The change correctly iterates over all subscriptions and adds a test case for the second-element mismatch scenario.

Clean, focused fix with proper test coverage. LGTM.


Automated review by github-manager-bot

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.

[Bug] Validate every Lite consumer subscription against its bound topic

2 participants