Scenario 02.1.3 · Committing offsets
Kafka committed offsets: enable.auto.commit and restart
The committed offset is the resume point. Auto-commit saves it periodically; manual commit lets the app choose when.
Run this scenario in the playgroundConsumer ready · auto-commit on. t+0.000s
Group g1 reads with enable.auto.commit=true. Watch the committed offset (the resume point), not just the live position.
Open at this step: step 1, Consumer ready · auto-commit onRead and committed up to 3. t+1.600s
The consumer read O1-O3 (position 3) and auto-commit saved that as the committed offset (3). The committed offset - not the position - is what survives a restart.
Open at this step: step 2, Read and committed up to 3Consumer crashed. t+2.400s
c1 crashed and stopped polling. Its committed offset (3) is held by the group coordinator, independent of the live member.
Open at this step: step 3, Consumer crashedRestarted · resumes at the committed offset. t+3.100s
c1 restarted and resumed at the committed offset 3 - it does NOT re-read O1-O3. Manual commit uses the same mechanism but the app picks exactly when to save, trading re-processing after a crash against losing un-committed work.
Open at this step: step 4, Restarted · resumes at the committed offsetWhat you start with
The committed offset is where a group resumes after a restart or rebalance, distinct from its live read position. This scenario shows enable.auto.commit periodically saving the position, then a crash-and-restart resuming from the committed offset instead of re-reading.
Step by step
- Consumer ready · auto-commit on t+0.000s Group g1 reads with enable.auto.commit=true. Watch the committed offset (the resume point), not just the live position. Open at this step: step 1, Consumer ready · auto-commit on
- Read and committed up to 3 t+1.600s The consumer read O1-O3 (position 3) and auto-commit saved that as the committed offset (3). The committed offset - not the position - is what survives a restart. Open at this step: step 2, Read and committed up to 3
- Consumer crashed t+2.400s c1 crashed and stopped polling. Its committed offset (3) is held by the group coordinator, independent of the live member. Open at this step: step 3, Consumer crashed
- Restarted · resumes at the committed offset t+3.100s c1 restarted and resumed at the committed offset 3 - it does NOT re-read O1-O3. Manual commit uses the same mechanism but the app picks exactly when to save, trading re-processing after a crash against losing un-committed work. Open at this step: step 4, Restarted · resumes at the committed offset
The takeaway
The committed offset is a durable bookmark, not the read position - commit timing is the lever between at-least-once and at-most-once, deciding how much is reprocessed or skipped after a failure.
Configs in this scenario
-
enable.Whether the consumer commits its offsets in the background every auto.commit.interval.ms (default true); with it on, records processed between the last commit and a crash are read again.auto. commit
Embed this scenario
Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.
<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=02.1.3" title="Kafka Simulator: Committing offsets" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/committing-offsets/">Kafka committed offsets: enable.auto.commit and restart</a></p> Further reading
More in Consumer groups
- Kafka consumer poll loop: subscribe, poll, fetch
- Kafka auto.offset.reset: earliest vs latest vs none
- Replay a Kafka topic: consumed records stay in the log
- Kafka consumer group: how partitions split across members
- Kafka consumer group rebalance when a consumer joins
- Kafka partition assignors: range vs round-robin vs sticky
- Kafka eager vs cooperative rebalancing (cooperative-sticky)
- Kafka consumer crash and session.timeout.ms
- Kafka max.poll.interval.ms: evicting a stuck consumer
- Kafka static membership: group.instance.id avoids rebalances
- Kafka consumer lag: why it grows and how it drains
- Evicted Kafka consumer: how a survivor takes its partition