conduktor.io ↗

Kafka LeaveGroup Response Wire Format v5 — Binary Protocol Layout

What is LeaveGroup?

Sent on clean consumer shutdown to trigger an immediate rebalance rather than waiting for the session timeout. Without it, a departed consumer's partitions stay unassigned for up to session.timeout.ms. Static membership (group.instance.id) avoids rebalances on short restarts by skipping LeaveGroup semantics.

Related Errors

COORDINATOR_NOT_AVAILABLE · GROUP_AUTHORIZATION_FAILED · INVALID_GROUP_ID · UNKNOWN_MEMBER_ID

Wire Diagram

Response Header · flexible
message_size int32 · 4B
correlation_id int32 · 4B
tagged var
LeaveGroupResponse v5
ThrottleTimeMs int32 · 4B
ErrorCode int16 · 2B
Members array
tagged var
MemberId string (compact)
GroupInstanceId? string (compact)
ErrorCode int16 · 2B
tagged var

Schema & Example

Schema
{
  "ThrottleTimeMs": int32,
  "ErrorCode": int16,
  "Members": [{
      "MemberId": string,
      "GroupInstanceId": string?,
      "ErrorCode": int16
  }]
}
Example
{
  "ThrottleTimeMs": 0,
  "ErrorCode": 0,
  "Members": [{
      "MemberId": "consumer-1-abc123",
      "GroupInstanceId": "instance-0",
      "ErrorCode": 0
  }]
}