Skip to content
Kafka Is FunProgress

IntermediateOperations

How do you reset consumer offsets to reprocess messages?

Reference answer

Use kafka-consumer-groups.sh --reset-offsets with: --to-earliest (reprocess all), --to-latest (skip to end), --to-offset <N> (specific offset), --shift-by <N> (relative shift), --to-datetime (reprocess from timestamp). Command: kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group my-group --topic my-topic --reset-offsets --to-earliest --execute. The consumer group MUST be stopped before resetting offsets. For datetime-based reset, the broker must have data with timestamps within the specified range.

Expected key concepts: reset-offsets, to-earliest, to-latest, to-offset, shift-by, to-datetime, consumer group, stopped, kafka-consumer-groups.sh