Kafka: auto.offset.reset only applies with no committed offset

It decides where a brand-new group starts, and is ignored once the group has committed anything.

Code
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");  // or "latest"
Output
earliest: a new group reads the whole retained history
latest:   a new group sees only what arrives after it starts

An existing group resumes from its committed offset either way.
Advertisement
More in KAFKA

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-11

© Java Coding Hub · About · Contact · Privacy · Terms