Status
Current state: "Under Discussion"
Discussion thread: TBD
JIRA: TBD
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
When groups are described, the DescribeGroupsResponse contains the metadata (also known as subscriptions) of the members but the metadata is not surfaced in the KafkaAdminClient#describeConsumerGroups method of the Admin Client. Surfacing the metadata is quite useful when it come to troubleshooting a consumer group (e.g. in the context of KIP-496). As the information is already in the protocol, it makes sense to expose it via the Admin Client.
Public Interfaces
org.apache.kafka.clients.admin.MemberDescription
The metadata method is added to the MemberDescription class and returns the metadata of the group member. The metadata is only computed when the group is a consumer group similarly to the existing assignment method.
/** * A detailed description of a single group instance in the cluster. */ public class MemberDescription { /** * Existing methods omitted for readability. */ /** * The metadata of the group member. */ public MemberMetadata metadata() { return metadata; } }
org.apache.kafka.clients.admin.MemberMetadata
The MemberMetadata is added and represents the metadata of the group member.
public class MemberMetadata { /** * The topics that the group member is subscribed to. */ public Set<String> topics() { return topics; } /** * The user data of the group member. */ public ByteBuffer userData() { return userData; } /** * The topic partitions owned by the group member. */ public Set<TopicPartition> ownedPartitions() { return ownedPartitions; }
Proposed Changes
The ConsumerGroupDescription returned by KafkaAdminClient#describeConsumerGroups includes the metadata of each member of the group. The MemberDescription class is extended to carry on the MemberMetadata as described above. The metadata is populated only when the group is a consumer group similarly to the assignments.
Compatibility, Deprecation, and Migration Plan
None
Rejected Alternatives
None