CodePark/ questions / Kafka: consumer groups & offsets
START PRACTICINGPRACTICE
Backend question · Message queues & streaming › Kafka: consumer groups & offsets

You deploy a brand-new consumer group, with default settings, against a topic that already holds a week of data. What does it read first?

Only records produced after the group starts, because auto.offset.reset defaults to latest

The group reads only new records. auto.offset.reset decides where a group starts when it has no committed offset yet. Its default is latest, so the group skips the records that already exist. Set it to earliest to read the history.

"The whole week of data, because new groups always start at the earliest offset" is wrong, because the default is
latest, not earliest.

"Whatever the last group that read the topic committed" is wrong, because Kafka stores offsets per group. Another group's progress has no effect.


"Nothing; it throws an error because it has no committed offset" happens only if you set
auto.offset.reset to none.