You have a Kafka consumer in production actively reading from a critical topic.
You need to update the offset of your consumer to start reading from the beginning of the topic.
Which action should you take?
Temporarily configure the topic’s retention.ms parameter to 0 to empty the topic.
Start a new consumer application with the same consumer group id.
Update the consumer configuration by setting auto.offset.reset=earliest.
Update the consumer group’s offset to the earliest position using the kafka-consumer-groups CLI tool.
To reset offsets for anexisting consumer group, you must use thekafka-consumer-groups.shtool with the --reset-offsets and --to-earliest flags.
FromKafka Consumer Group Tool Documentation:
“You can use the kafka-consumer-groups tool to reset offsets for a consumer group. This is required if the consumer has already committed offsets.”
Setting auto.offset.reset=earliest only worksif no committed offset exists.
Starting a new consumer with the same group won’t reset offsets.
Retention settings don’t affect committed offsets.
Submit