Skip to content

[ISSUE #10895] Validate every Lite consumer subscription against its bound topic - #10918

Open
123123213weqw wants to merge 5 commits into
apache:developfrom
123123213weqw:wangyue/issue-10895-lite-sub-topic-validation
Open

[ISSUE #10895] Validate every Lite consumer subscription against its bound topic#10918
123123213weqw wants to merge 5 commits into
apache:developfrom
123123213weqw:wangyue/issue-10895-lite-sub-topic-validation

Conversation

@123123213weqw

Copy link
Copy Markdown

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

  • ClientProcessor: validateLiteSubTopic now checks every subscription in the set against the configured bound topic and rejects any mismatch with ILLEGAL_TOPIC

How was this patch verified

  • Code review: each SubscriptionData.topic is passed through validateLiteBindTopic
  • git diff --check clean

@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

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

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

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