Bird
0
0

You want to list all topics on a Kafka server at localhost:9092. Which command correctly lists the topics?

hard📝 Application Q15 of 15
Kafka - Basics and Event Streaming
You want to list all topics on a Kafka server at localhost:9092. Which command correctly lists the topics?
A<code>kafka-console-producer.sh --list --bootstrap-server localhost:9092</code>
B<code>kafka-console-consumer.sh --list --bootstrap-server localhost:9092</code>
C<code>kafka-topics.sh --list --bootstrap-server localhost:9092</code>
D<code>kafka-configs.sh --list --bootstrap-server localhost:9092</code>
Step-by-Step Solution
Solution:
  1. Step 1: Identify the tool for listing topics

    The kafka-topics.sh tool manages topics and supports the --list option to show all topics.
  2. Step 2: Confirm the correct command syntax

    Using --bootstrap-server localhost:9092 specifies the Kafka server to connect to.
  3. Final Answer:

    kafka-topics.sh --list --bootstrap-server localhost:9092 -> Option C
  4. Quick Check:

    List topics with kafka-topics.sh --list [OK]
Quick Trick: Use kafka-topics.sh with --list to see all topics [OK]
Common Mistakes:
  • Using consumer or producer tools to list topics
  • Omitting --bootstrap-server causing connection failure
  • Using kafka-configs.sh which lists configs, not topics

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes