KIP-1092 — Extend Consumer#close with an option to leave the group or not
Accepted Kafka 4.1 ConsumerStreams
Adds a `leaveGroup` boolean option to `KafkaConsumer#close()` (and `KafkaStreams#close(CloseOptions)`) so callers can control whether the consumer sends a `LeaveGroup` request before closing, triggering an immediate rebalance. Kafka Streams hardcodes `internal.leave.group.on.close=false` for efficiency during topology restarts, but this makes graceful scale-down scenarios wait for the session timeout to expire before triggering a rebalance.
Details
| Author | TengYao Chi |
| Status | Accepted |
| Kafka Version | 4.1 |
| JIRA | KAFKA-16758 |
| Wiki | View on Apache Wiki |
| Created | 2024-09-17 |
| Last Modified | 2025-04-26 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.