Bird
0
0

Which of the following is the correct way to create a topic in Kafka using the command line?

easy📝 Syntax Q12 of 15
Kafka - Topics and Partitions
Which of the following is the correct way to create a topic in Kafka using the command line?
Akafka topic create myTopic --partitions 3
Bkafka-topics --create --topic myTopic --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092
Ccreate kafka topic myTopic partitions=3
Dkafka-create-topic --name myTopic --partitions 3
Step-by-Step Solution
Solution:
  1. Step 1: Recall the Kafka CLI syntax for topic creation

    The correct command uses 'kafka-topics' with '--create' and required flags.
  2. Step 2: Match the command with the correct options

    kafka-topics --create --topic myTopic --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092 matches the official syntax including bootstrap-server, partitions, and replication-factor.
  3. Final Answer:

    kafka-topics --create --topic myTopic --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092 -> Option B
  4. Quick Check:

    Correct Kafka topic creation syntax = D [OK]
Quick Trick: Use kafka-topics with --create and required flags [OK]
Common Mistakes:
  • Using incorrect command names like kafka-create-topic
  • Omitting bootstrap-server flag
  • Wrong order or missing required flags

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes