Kafka - Basics and Event StreamingWhich of the following is the correct syntax to create a Kafka topic named 'logs' with 3 partitions using the Kafka CLI?Akafka-topics --create --topic logs --partitions 3 --bootstrap-server localhost:9092Bkafka-create-topic --name logs --partitions 3Ccreate topic logs with partitions=3Dkafka-topics --new --topic logs --partitions=3Check Answer
Step-by-Step SolutionSolution:Step 1: Recall Kafka CLI topic creation syntaxThe correct command uses 'kafka-topics --create' with '--topic', '--partitions', and '--bootstrap-server' flags.Step 2: Check each optionkafka-topics --create --topic logs --partitions 3 --bootstrap-server localhost:9092 matches the correct syntax; others use invalid commands or flags.Final Answer:kafka-topics --create --topic logs --partitions 3 --bootstrap-server localhost:9092 -> Option AQuick Check:Kafka topic creation syntax = kafka-topics --create --topic logs --partitions 3 --bootstrap-server localhost:9092 [OK]Quick Trick: Use kafka-topics --create with --topic and --partitions [OK]Common Mistakes:Using wrong command like kafka-create-topicOmitting --bootstrap-server flagIncorrect flag names or syntax
Master "Basics and Event Streaming" in Kafka9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kafka Quizzes Consumer Groups - Partition assignment - Quiz 4medium Consumer Groups - Cooperative vs eager rebalancing - Quiz 6medium Consumers - Consumer configuration - Quiz 8hard Consumers - Subscribing to topics - Quiz 10hard Consumers - Offset management - Quiz 7medium Kafka Basics and Event Streaming - Kafka vs RabbitMQ vs Redis Pub/Sub - Quiz 3easy Kafka Basics and Event Streaming - Why Kafka exists - Quiz 13medium Producers - Message key and value - Quiz 9hard Producers - Batching and linger configuration - Quiz 3easy Topics and Partitions - Topic creation - Quiz 3easy