Scrivio Interview library
ConceptFoundations6 min read · updated 13 November 2026

Every consumer group must decide where in a partition to start reading, and auto.offset.reset is the setting that steers that decision.

When does auto.offset.reset apply in a Kafka consumer, and what do earliest, latest and none do? Why can latest, the default, silently skip data, and what newer option exists in recent clients?

auto.offset.reset applies only when the group has no committed offset for a partition, or its committed offset is out of range, usually because retention deleted that data. earliest starts at the log start offset, latest at the end so only new records are read, and none throws an exception (NoOffsetForPartitionException, or OffsetOutOfRangeException) so the application decides. latest, the default, silently skips data whenever a new group starts or a group's offsets expire after offsets.retention.minutes (7 days for an empty group), and Kafka 4.0 clients add a by_duration option that starts from a point in time, such as one hour ago.

Why this question is asked

Most consumers set auto.offset.reset once and forget it, and most of the time it does nothing at all. But on the rare days it does act, a new deployment, a group that was idle for a week, an outage longer than retention, it decides whether data is read, re-read or silently skipped. Interviewers ask about it because the default can lose data without any error. In this answer, we will recap committed offsets, see exactly when the setting applies, go through the options, show how latest skips data quietly, and look at the newer by_duration option.

1A Quick Recap of Committed Offsets

Each record in a partition has an offset, its position number. A consumer group remembers its progress by committing, for each partition, the offset of the next record it should read. These commits are stored in an internal topic, __consumer_offsets. When a consumer in the group is assigned a partition, it asks for the committed offset and starts reading there.

The log does not start at offset 0 forever. Retention deletes old segments, so each partition has a log start offset, the oldest record still on disk, and a log end offset, the next offset to be written.

2When auto.offset.reset Applies

The setting is used in only two situations. The first is when there is no committed offset for the partition in this group: a brand-new group, a partition added to the topic after the group started, or a group whose committed offsets have expired. The second is when the committed offset is out of range, which almost always means it is older than the log start offset because retention has deleted the data it pointed to.

In every other case, the committed offset wins, and changing auto.offset.reset has no effect. That surprises many people who change the setting to earliest and expect their existing group to re-read the topic: it will not, because the group already has committed offsets.

Step throughHow a consumer chooses where to start
  1. Does the group have a committed offset for the partition?
    YesCheck it is still in the logNoUse auto.offset.reset
  2. Is the committed offset within the log?
    YesStart at the committed offsetNoUse auto.offset.reset
  3. auto.offset.resetearliest: log start; latest: log end; none: throw; by_duration: point in time

3 steps in order. Play them, or step through them one at a time.

Most of the time the first two answers are yes and the setting never matters.

3What earliest, latest and none Do

earliest starts at the log start offset, the oldest record retention has kept, so the consumer reads everything still available. latest starts at the log end offset, so it reads only records written after it starts. none refuses to guess: the consumer throws an exception, NoOffsetForPartitionException when there is no committed offset or OffsetOutOfRangeException when the committed offset is out of range, and the application must decide what to do, for example alert and seek explicitly.

Java
props.put("group.id", "invoice-builder");
props.put("auto.offset.reset", "earliest"); // new group reads all retained data
// Spring Boot
spring.kafka.consumer.auto-offset-reset=earliest
// none: the application decides
props.put("auto.offset.reset", "none");
consumer.poll(Duration.ofSeconds(1));
// NoOffsetForPartitionException: Undefined offset with no reset policy for partitions: [invoices-0]

4Why latest Can Silently Skip Data

latest is the default, and its failure mode is quiet. A new consumer group deployed with latest starts at the end of every partition, so every record written before its first poll is never seen by it, and nothing logs an error. If a producer service is deployed a minute before the new consumer, that minute of events is simply not processed.

The same happens with expiring offsets. When a group has no active members, its committed offsets are kept for offsets.retention.minutes, 10,080 minutes or 7 days by default, counted from when the group became empty. A group that is stopped for longer, for example a monthly batch job, loses its offsets. On its next start, latest jumps to the end and skips everything written since its last run. And when a committed offset falls behind retention, latest skips not only the deleted data but everything still on disk too. The client logs an INFO line about resetting the offset, and lag drops to zero, which looks like good news.

So for consumers that must not miss data, earliest is the safer choice for new groups, and none with explicit handling is the safest choice for critical ones, because it turns a silent jump into an error someone must look at.

5The Newer Option: by_duration

Recent clients, Kafka 4.0 and later, also accept a duration-based policy written as by_duration: followed by an ISO-8601 duration, for example by_duration:PT1H for one hour. When the reset applies, the consumer starts at the first record whose timestamp is within that duration of now, which avoids both extremes: not the whole retained history, and not nothing.

This is useful for consumers where recent data matters but a full replay would be expensive, such as a cache warmer or a dashboard. Check your client version before relying on it, since older clients reject the value.

Java
props.put("auto.offset.reset", "by_duration:PT1H"); // Kafka 4.0+ clients: start one hour back
// older clients: ConfigException, invalid value

6Follow-up questions

How do I make an existing group re-read a topic?

Changing auto.offset.reset does nothing, because the group has committed offsets. Stop the group and reset its offsets with kafka-consumer-groups.sh --reset-offsets (for example --to-earliest or --to-datetime), with a dry run first, or seek explicitly in code on assignment, or use a new group id.

Is earliest always safe?

It never skips data, but a new group with earliest on a topic with 30 days of retention reprocesses 30 days of records, which may mean a long catch-up and repeated side effects. So we choose it consciously, and make processing idempotent.

7Conclusion

In this answer, we saw that auto.offset.reset applies only when a group has no committed offset for a partition or its offset is out of range because retention deleted the data. earliest starts at the log start, latest at the end, and none throws so the application decides. Because latest is the default, a new group, a group whose offsets expired after 7 days without members, or a group behind retention jumps to the end with no error. Kafka 4.0 clients add by_duration, which starts from a point in time such as one hour ago.

What to say in the interviewAbout 90 seconds aloud

Open with

auto.offset.reset only matters in two situations: when the group has no committed offset for a partition, which means a new group, a newly added partition, or offsets that expired, and when the committed offset is out of range, usually because retention deleted the data it pointed to.

Then, if they want more

Otherwise the committed offset always wins, so changing this setting on an existing group does nothing. earliest starts at the log start offset, the oldest retained record. latest starts at the end and only reads new records. none throws, NoOffsetForPartitionException or OffsetOutOfRangeException, and lets the application decide, which is what I want for critical consumers.

The danger is that latest is the default and it fails silently. A new group deployed with latest never sees anything written before it started. A group with no members keeps its offsets for offsets.retention.minutes, seven days by default; after that, the next start jumps to the end.

And if a group falls behind retention, latest skips even the data still on disk. There is just an INFO log line and lag goes to zero, which looks healthy. So I use earliest for new groups that must not miss data and none for critical ones.

Kafka 4.0 clients also accept by_duration, for example one hour back, which starts from a point in time; I would check the client version first.

About this answer

Last updated
13 November 2026
Versions it names
Kafka 4.0
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Apache Kafka documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "When does auto.offset.reset apply in a Kafka consumer, and what do earliest, latest and...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-clients-in-depth/9f7e0acb14/