Bird
0
0

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

easy📝 Syntax Q3 of 15
Kafka - Basics and Event Streaming
Which of the following is the correct syntax to create a Kafka topic using the command line?
Acreate kafka topic myTopic with 3 partitions and 1 replica
Bkafka-create-topic --name myTopic --partitions 3 --replicas 1
Ckafka-topics --create --topic myTopic --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092
Dkafka-topic-create --topic myTopic --partitions 3
Step-by-Step Solution
Solution:
  1. Step 1: Recall Kafka topic creation command

    The official command uses 'kafka-topics' with '--create' and required flags.
  2. Step 2: Match syntax

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

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

    Correct Kafka topic creation syntax = kafka-topics --create --topic myTopic --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092 [OK]
Quick Trick: Use kafka-topics with --create and --bootstrap-server [OK]
Common Mistakes:
  • Using wrong command name
  • Omitting bootstrap-server
  • Incorrect flags or missing replication-factor

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes