IntermediateOperations
How do you reset consumer offsets to reprocess messages?
Reference answer
Use kafka-consumer-groups.sh with --reset-offsets and a scope: --topic or --all-topics. The scenarios include --to-earliest, --to-latest, --to-offset <N>, --shift-by <N> (relative), --to-datetime, --by-duration, --to-current and --from-file. Without --execute the command only shows a preview of the new offsets; --execute applies them and --export writes them as CSV. Example: kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group my-group --topic my-topic --reset-offsets --to-earliest --execute. First make sure the consumer instances in the group are inactive. Offsets that fall out of range are adjusted to the available offset end.
Expected key concepts: reset-offsets, to-earliest, to-latest, to-offset, shift-by, to-datetime, inactive, kafka-consumer-groups.sh, --execute
How did that feel?
Your own verdict, not the score. It shows up next to this question in the list, so you can come back to the shaky ones.