KIP-1094 — Add a new constructor with nextOffsets to ConsumerRecords
Accepted Kafka 4.0 Consumer
Adds a `nextOffsets` map to `ConsumerRecords` that exposes, per partition, the offset to be fetched in the next `poll()` call (i.e., `lastOffset + 1`), pre-wrapped in `OffsetAndMetadata`. This allows Kafka Streams and other frameworks to commit precise next-fetch offsets without re-computing them from the last received record.
Details
| Author | Alieh Saeedi |
| Status | Accepted |
| Kafka Version | 4.0 |
| JIRA | KAFKA-17600 |
| Wiki | View on Apache Wiki |
| Created | 2024-09-24 |
| Last Modified | 2024-10-14 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.