Skip to content

KAFKA-18157: Consider UnsupportedVersionException child class to represent the case of unsupported fields#22405

Open
alanlau28 wants to merge 2 commits into
apache:trunkfrom
alanlau28:KAFKA-18157
Open

KAFKA-18157: Consider UnsupportedVersionException child class to represent the case of unsupported fields#22405
alanlau28 wants to merge 2 commits into
apache:trunkfrom
alanlau28:KAFKA-18157

Conversation

@alanlau28
Copy link
Copy Markdown

Jira: https://issues.apache.org/jira/browse/KAFKA-18157

This is a rebase of #18072 onto current trunk, plus the additional scope requested

Add a new exception class, UnsupportedProtocolFieldException, as a
subclass of UnsupportedVersionException, to provide a more specific
message for unsupported fields.

ConsumerGroupHeartbeatRequest.Builder now throws UnsupportedProtocolFieldException
when subscribedTopicRegex is set against a server that only supports v0.
ConsumerHeartbeatRequestManager uses instanceof UnsupportedProtocolFieldException
to detect this case instead of comparing message strings. Any future field-validation
errors added to ConsumerGroupHeartbeatRequest.Builder will be caught by the same
instanceof check automatically, but the error message propagated to the user will need to
be updated accordingly.

@github-actions github-actions Bot added consumer clients triage PRs from the community labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants