Kafka - Basics and Event StreamingWhich 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 replicaBkafka-create-topic --name myTopic --partitions 3 --replicas 1Ckafka-topics --create --topic myTopic --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092Dkafka-topic-create --topic myTopic --partitions 3Check Answer
Step-by-Step SolutionSolution:Step 1: Recall Kafka topic creation commandThe official command uses 'kafka-topics' with '--create' and required flags.Step 2: Match syntaxkafka-topics --create --topic myTopic --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092 matches the correct syntax with bootstrap-server, partitions, and replication-factor.Final Answer:kafka-topics --create --topic myTopic --partitions 3 --replication-factor 1 --bootstrap-server localhost:9092 -> Option CQuick 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 nameOmitting bootstrap-serverIncorrect flags or missing replication-factor
Master "Basics and Event Streaming" in Kafka9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kafka Quizzes Consumers - Auto-commit vs manual commit - Quiz 12easy Consumers - Consumer API basics - Quiz 8hard Consumers - Consumer API basics - Quiz 7medium Consumers - Subscribing to topics - Quiz 6medium Kafka Basics and Event Streaming - Why Kafka exists - Quiz 7medium Kafka Basics and Event Streaming - Message broker architecture - Quiz 15hard Kafka Cluster Architecture - Broker nodes - Quiz 13medium Kafka Cluster Architecture - ZooKeeper role (and KRaft replacement) - Quiz 1easy Topics and Partitions - Retention policies (time-based, size-based) - Quiz 2easy Topics and Partitions - Topic creation - Quiz 15hard