Skip to content

binding-kafka: add DescribeGroups (API key 15) support #1701

@jfallows

Description

@jfallows

Summary

Add DESCRIBE_GROUPS (API key 15) to the KafkaApi enum and
KafkaRequestBeginEx / KafkaResponseBeginEx unions. Required by the
mcp_kafka describe_consumer_group tool.

Required changes to kafka.idl

Add to KafkaApi enum:

DESCRIBE_GROUPS (15)

Add new request and response structs:

struct KafkaDescribeGroupMember
{
    string16 memberId;
    string16 clientId;
    string16 clientHost;
    varint32 metadataLen;
    octets[metadataLen] metadata = null;
    varint32 assignmentLen;
    octets[assignmentLen] assignment = null;
}

struct KafkaDescribeGroupInfo
{
    int16 error;
    string16 groupId;
    string16 groupState;
    string16 protocolType;
    string16 protocol;
    KafkaDescribeGroupMember[] members;
}

struct KafkaDescribeGroupsRequestBeginEx
{
    string16[] groupIds;
    uint8 includeAuthorizedOperations;
}

struct KafkaDescribeGroupsResponseBeginEx
{
    int32 throttle;
    KafkaDescribeGroupInfo[] groups;
}

Add to KafkaRequestBeginEx union:

case 15: kafka::stream::KafkaDescribeGroupsRequestBeginEx describeGroups;

Add to KafkaResponseBeginEx union:

case 15: kafka::stream::KafkaDescribeGroupsResponseBeginEx describeGroups;

Notes

Per-partition lag calculation for describe_consumer_group is the
responsibility of mcp_kafka, not binding-kafka. binding-kafka provides
raw group membership and assignment data; mcp_kafka combines this with
KafkaOffsetFetchBeginEx and latest offsets from KafkaFetchBeginEx to
compute lag.

Spec test coverage

Add scenarios to specs/binding-kafka.spec/ covering:

  • DescribeGroups for a single active group with members and assignments
  • DescribeGroups for an empty/dead group
  • DescribeGroups for multiple groups in a single request
  • Error response for unknown group

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions