It decides where a brand-new group starts, and is ignored once the group has committed anything.
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); // or "latest"
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.
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