Bird
0
0

You want to reset the offset of a consumer group named 'group1' for topic 'topicA' to the earliest offset using Kafka CLI. Which tool and command would you use?

hard📝 Application Q8 of 15
Kafka - Basics and Event Streaming
You want to reset the offset of a consumer group named 'group1' for topic 'topicA' to the earliest offset using Kafka CLI. Which tool and command would you use?
Akafka-configs.sh --entity-type topics --entity-name topicA --alter --add-config offset.reset=earliest
Bkafka-topics.sh --alter --topic topicA --reset-offset group1 --to-earliest
Ckafka-consumer-groups.sh --bootstrap-server localhost:9092 --group group1 --topic topicA --reset-offsets --to-earliest --execute
Dkafka-console-consumer.sh --group group1 --topic topicA --from-beginning
Step-by-Step Solution
Solution:
  1. Step 1: Identify the tool for consumer group offset management

    kafka-consumer-groups.sh manages consumer groups and offsets.
  2. Step 2: Use the --reset-offsets option with --to-earliest and --execute flags

    This resets the group's offset to the earliest for the specified topic.
  3. Final Answer:

    kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group group1 --topic topicA --reset-offsets --to-earliest --execute -> Option C
  4. Quick Check:

    Reset offsets = kafka-consumer-groups.sh with --reset-offsets [OK]
Quick Trick: Use kafka-consumer-groups.sh with --reset-offsets to change offsets [OK]
Common Mistakes:
  • Using kafka-topics.sh to reset offsets
  • Using kafka-console-consumer.sh which only reads messages
  • Trying to configure offsets via kafka-configs.sh

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes