Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Kafka Streams Group Protocol APIs

Kafka Streams groups use a broker-driven group protocol for membership, topology validation, and active, standby, and warm-up task assignment. These APIs are separate from the classic consumer group protocol and the KIP-848 consumer group protocol.

API keyNameKafka 4.4 versionsPurpose
88StreamsGroupHeartbeat0-1Join, leave, heartbeat, publish member state, and receive task assignments
89StreamsGroupDescribe0-1Inspect Streams group topology, members, assignments, and status
93StreamsGroupTopologyDescriptionUpdate0Store a detailed processing-topology description

All three APIs use flexible message encoding. Requests use header version 2 and responses use header version 1 in Kafka 4.4.


StreamsGroupHeartbeat is the membership and assignment API for Streams groups. Unlike the classic JoinGroup and SyncGroup exchange, a member sends its state in heartbeats and the coordinator returns incremental assignment information.

VersionKafkaChange
04.0.0Initial Streams group protocol
14.4.0Adds AcceptableRecoveryLag, negotiates TopologyDescriptionRequired, and permits MISSING_CLIENT_TAGS
StreamsGroupHeartbeatRequest =>
group_id: COMPACT_STRING
member_id: COMPACT_STRING
member_epoch: INT32
endpoint_information_epoch: INT32
instance_id: COMPACT_NULLABLE_STRING
rack_id: COMPACT_NULLABLE_STRING
rebalance_timeout_ms: INT32
topology: Topology # nullable
active_tasks: COMPACT_NULLABLE_ARRAY<TaskIds>
standby_tasks: COMPACT_NULLABLE_ARRAY<TaskIds>
warmup_tasks: COMPACT_NULLABLE_ARRAY<TaskIds>
process_id: COMPACT_NULLABLE_STRING
user_endpoint: NULLABLE_Endpoint
client_tags: COMPACT_NULLABLE_ARRAY<KeyValue>
task_offsets: COMPACT_NULLABLE_ARRAY<TaskOffset>
task_end_offsets: COMPACT_NULLABLE_ARRAY<TaskOffset>
shutdown_application: BOOLEAN

The initial heartbeat uses member_epoch=0 and includes a non-empty topology. A normal heartbeat may omit nullable fields that have not changed. member_epoch=-1 leaves the group; member_epoch=-2 asks a static member to rejoin.

StreamsGroupHeartbeatResponse =>
throttle_time_ms: INT32
error_code: INT16
error_message: COMPACT_NULLABLE_STRING
member_id: COMPACT_STRING
member_epoch: INT32
heartbeat_interval_ms: INT32
acceptable_recovery_lag_legacy: INT32 # v0 only
task_offset_interval_ms: INT32
acceptable_recovery_lag: INT64 # v1+
status: COMPACT_NULLABLE_ARRAY<Status>
active_tasks: COMPACT_NULLABLE_ARRAY<TaskIds>
standby_tasks: COMPACT_NULLABLE_ARRAY<TaskIds>
warmup_tasks: COMPACT_NULLABLE_ARRAY<TaskIds>
topology_description_required: BOOLEAN # v1+
endpoint_information_epoch: INT32
partitions_by_user_endpoint: COMPACT_NULLABLE_ARRAY<EndpointToPartitions>

topology_description_required=true tells a v1 client to send API 93. Status code 6, MISSING_CLIENT_TAGS, is valid only with v1; v0 clients do not understand it.

AssignmentMeaning
Active tasksProcess input and update state stores
Standby tasksMaintain replicated state for failover
Warm-up tasksRestore state before promotion

Members must fence stale responses by member epoch and must not continue processing tasks revoked by a newer assignment.


StreamsGroupDescribe returns coordinator state for one or more Streams groups.

VersionKafkaChange
04.0.0Group, topology, member, and assignment state
14.4.0Adds IncludeTopologyDescription, topology-description status and data, and AssignorName
StreamsGroupDescribeRequest =>
group_ids: COMPACT_ARRAY<COMPACT_STRING>
include_authorized_operations: BOOLEAN
include_topology_description: BOOLEAN # v1+

Each group result contains its error, group and assignment epochs, initialized topology, members, current and target assignments, and optional authorized operations. Version 1 can additionally return:

FieldMeaning
topology_description_status0=NOT_REQUESTED, 1=NOT_STORED, 2=ERROR, 3=AVAILABLE
topology_descriptionProcessing nodes, edges, stores, and global stores when status is AVAILABLE
assignor_nameAssignor selected for the next assignment computation

topology_description is non-null only when its status is AVAILABLE.


StreamsGroupTopologyDescriptionUpdate API (Key 93)

Section titled “StreamsGroupTopologyDescriptionUpdate API (Key 93)”

Kafka 4.4 adds this API so a group member can push the detailed processing graph requested by StreamsGroupHeartbeat v1.

StreamsGroupTopologyDescriptionUpdateRequest =>
group_id: COMPACT_STRING
member_id: COMPACT_STRING
topology_epoch: INT32
topology_description: TopologyDescription
TopologyDescription =>
subtopologies: COMPACT_ARRAY<TopologyDescriptionSubtopology>
global_stores: COMPACT_ARRAY<TopologyDescriptionGlobalStore>
TopologyDescriptionNode =>
name: COMPACT_STRING
node_type: INT8 # 1=SOURCE, 2=PROCESSOR, 3=SINK
source_topics: COMPACT_ARRAY<COMPACT_STRING>
sink_topic: COMPACT_NULLABLE_STRING
stores: COMPACT_ARRAY<COMPACT_STRING>
successors: COMPACT_ARRAY<COMPACT_STRING>

The coordinator validates that member_id still belongs to the group and that topology_epoch is current. A deleted group or mismatched member returns UNKNOWN_MEMBER_ID, causing the client to treat itself as fenced and rejoin.

StreamsGroupTopologyDescriptionUpdateResponse =>
throttle_time_ms: INT32
error_code: INT16
error_message: COMPACT_NULLABLE_STRING

Important errors include UNKNOWN_MEMBER_ID, GROUP_ID_NOT_FOUND, STREAMS_INVALID_TOPOLOGY_EPOCH, and STREAMS_TOPOLOGY_DESCRIPTION_UPDATE_FAILED.


  1. The client joins with StreamsGroupHeartbeat v1, member_epoch=0, and its topology.
  2. The coordinator returns the member epoch, task assignment, heartbeat interval, and topology_description_required flag.
  3. When the flag is true, the client sends StreamsGroupTopologyDescriptionUpdate v0 and handles any topology validation error.
  4. At each coordinator-provided interval, the client heartbeats with its current tasks and offsets and reconciles any incremental assignment in the response.