auto.offset.reset — Kafka Consumer Configuration
What to do when there is no initial offset in Kafka or if the current offset does not exist any more on the server (e.g. because that data has been deleted):earliest: automatically reset the offset to the earliest offsetlatest: automatically reset the offset to the latest offsetby_duration:<duration>: automatically reset the offset to a configured <duration> from the current timestamp
Description
What to do when there is no initial offset in Kafka or if the current offset does not exist any more on the server (e.g. because that data has been deleted):earliest: automatically reset the offset to the earliest offsetlatest: automatically reset the offset to the latest offsetby_duration:<duration>: automatically reset the offset to a configured <duration> from the current timestamp. <duration> must be specified in ISO8601 format (PnDTnHnMn.nS). Negative duration is not allowed.none: throw exception to the consumer if no previous offset is found for the consumer's groupanything else: throw exception to the consumer.Note that increasing a topic's partition count while this config is set to latest may cause silent message loss: producers may begin appending records to a newly created partition before the consumer discovers it, and latest resets the position to the log end offset, skipping any records produced during that discovery gap.To avoid this, prefer by_duration:<duration>. When a partition has no committed offset, by_duration determines the starting position by issuing a ListOffsets lookup for now() - duration. If the target timestamp is earlier than the partition's creation time, the lookup returns the partition's start offset, ensuring that records produced during the discovery window are still consumed. Size the duration to cover the worst-case partition-discovery latency for the group protocol in use:With the consumer group protocol (KIP-848), newly assigned partitions are pushed on the next group heartbeat, so a value at least as large as group.consumer.heartbeat.interval.ms (server default 5000 ms) is sufficient, for example by_duration:PT5S.With the classic group protocol, new partitions are discovered through periodic metadata refresh and a subsequent rebalance, so the duration must exceed metadata.max.age.ms (client default 300000 ms) plus the rebalance time, for example by_duration:PT6M.Consumers with a valid committed offset are unaffected. The reset applies only to partitions whose offset is missing or out of range, so by_duration does not force existing consumers to replay historical data on restart.
Default Values by Kafka Version
| Component | Kafka version line | Documented default |
|---|---|---|
| Consumer | 0.8.0 | largest |
| Consumer | 0.8.1 | largest |
| Consumer | 0.8.2 | largest |
| Consumer | 0.9.0 | largest |
| Consumer | 0.10.0 | largest |
| Consumer | 0.10.1 | latest |
| Consumer | 0.10.2 | latest |
| Consumer | 0.11.0 | latest |
| Consumer | 1.0 | latest |
| Consumer | 1.1 | latest |
| Consumer | 2.0 | latest |
| Consumer | 2.1 | latest |
| Consumer | 2.2 | latest |
| Consumer | 2.3 | latest |
| Consumer | 2.4 | latest |
| Consumer | 2.5 | latest |
| Consumer | 2.6 | latest |
| Consumer | 2.7 | latest |
| Consumer | 2.8 | latest |
| Consumer | 3.0 | latest |
| Consumer | 3.1 | latest |
| Consumer | 3.2 | latest |
| Consumer | 3.3 | latest |
| Consumer | 3.4 | latest |
| Consumer | 3.5 | latest |
| Consumer | 3.6 | latest |
| Consumer | 3.7 | latest |
| Consumer | 3.8 | latest |
| Consumer | 3.9 | latest |
| Consumer | 4.0 | latest |
| Consumer | 4.1 | latest |
| Consumer | 4.2 | latest |
| Consumer | 4.3 | latest |
| Consumer | 4.4 | latest |
Tuning Recommendation
Workload-dependent proposals, not benchmarked defaults. Review the versioned Config Advisor before applying.
| Profile | Proposal | Rationale and tradeoff |
|---|---|---|
| consumer / latency | latest | Chooses a start position when no valid committed offset exists; it does not reset an existing valid offset on every restart. Tradeoff: earliest can replay retained history; latest can skip existing records when no valid offset exists. Neither recovers data already deleted by retention. Reference · 2026-10-27 |
| consumer / durability | earliest | Chooses a start position when no valid committed offset exists; it does not reset an existing valid offset on every restart. Tradeoff: earliest can replay retained history; latest can skip existing records when no valid offset exists. Neither recovers data already deleted by retention. Reference · 2026-10-27 |
Related Configs
enable.auto.commit · isolation.level