conduktor.io ↗

Kafka ConsumerGroupHeartbeat Request Wire Format v1 — Binary Protocol Layout

What is ConsumerGroupHeartbeat?

The new consumer protocol (KIP-848) combines liveness, subscription updates, and incremental assignment acknowledgment into a single recurring heartbeat. Unlike classic JoinGroup/SyncGroup, this protocol supports incremental partition assignment, avoiding stop-the-world rebalances in large consumer groups.

Related Errors

COORDINATOR_NOT_AVAILABLE · FENCED_MEMBER_EPOCH · GROUP_AUTHORIZATION_FAILED · MEMBER_ID_REQUIRED · STALE_MEMBER_EPOCH · TOPIC_AUTHORIZATION_FAILED · UNRELEASED_INSTANCE_ID · UNSUPPORTED_ASSIGNOR · UNSUPPORTED_VERSION

Wire Diagram

Request Header · flexible
message_size int32 · 4B
api_key int16 · 2B
api_version int16 · 2B
correlation_id int32 · 4B
client_id string (compact)
tagged var
ConsumerGroupHeartbeatRequest v1
GroupId string (compact)
MemberId string (compact)
MemberEpoch int32 · 4B
InstanceId? string (compact)
RackId? string (compact)
RebalanceTimeoutMs int32 · 4B
SubscribedTopicNames? []string
SubscribedTopicRegex? string (compact)
ServerAssignor? string (compact)
TopicPartitions? array
tagged var
TopicId uuid · 16B
Partitions []int32
tagged var

Schema & Example

Schema
{
  "GroupId": string,
  "MemberId": string,
  "MemberEpoch": int32,
  "InstanceId": string?,
  "RackId": string?,
  "RebalanceTimeoutMs": int32,
  "SubscribedTopicNames": [string]?,
  "SubscribedTopicRegex": string?,
  "ServerAssignor": string?,
  "TopicPartitions": [{
      "TopicId": uuid,
      "Partitions": [int32]
  }]?
}
Example
{
  "GroupId": "order-processors",
  "MemberId": "consumer-1-abc123",
  "MemberEpoch": 12,
  "InstanceId": "abc-123",
  "RackId": null,
  "RebalanceTimeoutMs": 300000,
  "SubscribedTopicNames": ["value-1", "value-2"],
  "SubscribedTopicRegex": "orders-.*",
  "ServerAssignor": null,
  "TopicPartitions": [{
      "TopicId": "550e8400-e29b-41d4-a716-446655440000",
      "Partitions": [1, 2, 3]
  }]?
}