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.
| Version | Kafka | Changes |
|---|---|---|
| LeaveGroupRequest | ||
| v0 | 2.2 | + GroupId string+ MemberId string |
| v1 | 2.2 | are the same as version 0. |
| v2 | 2.2 | are the same as version 0. |
| v3 | 2.4 | + Members []MemberIdentity+ MemberId string+ GroupInstanceId string- MemberId stringdefines batch processing scheme with group.instance.id + member.id for identity |
| v4 | 2.4 | ~ Flexible encoding enabled FLEXIBLE is the first flexible version. |
| v5 | 3.2 | + Reason stringadds the Reason field (KIP-800). |
| LeaveGroupResponse | ||
| v0 | 2.2 | + ErrorCode int16 |
| v1 | 2.2 | + ThrottleTimeMs int32adds the throttle time. |
| v2 | 2.2 | on quota violation, brokers send out responses before throttling. |
| v3 | 2.4 | + Members []MemberResponse+ MemberId string+ GroupInstanceId string+ ErrorCode int16we will make leave group request into batch mode and add group.instance.id. |
| v4 | 2.4 | ~ Flexible encoding enabled FLEXIBLE is the first flexible version. |
| v5 | 3.2 | is the same as version 4. |