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.
Wire Diagram
Response Header
message_size
int32 · 4B
correlation_id
int32 · 4B
LeaveGroupResponse v3
ThrottleTimeMs
int32 · 4B
ErrorCode
int16 · 2B
MemberId
string
GroupInstanceId?
string
ErrorCode
int16 · 2B
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": null, "ErrorCode": 0 }] }