Kafka - Topics and PartitionsIf no partition key is provided when sending a message in Kafka, what happens?AThe message is rejectedBKafka uses the message timestamp as the keyCThe message is sent to partition 0 alwaysDKafka assigns the message to a random partitionCheck Answer
Step-by-Step SolutionSolution:Step 1: Check Kafka behavior without partition keyIf no key is provided, Kafka uses a round-robin or random approach to assign partitions.Step 2: Understand default partition assignmentThis ensures load is balanced across partitions when no key guides routing.Final Answer:Kafka assigns the message to a random partition -> Option DQuick Check:No key means random partition assignment [OK]Quick Trick: No key means random partition choice [OK]Common Mistakes:Assuming message is rejected without keyThinking message always goes to partition 0Believing timestamp is used as key automatically
Master "Topics and Partitions" in Kafka9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kafka Quizzes Consumer Groups - Cooperative vs eager rebalancing - Quiz 9hard Consumer Groups - Cooperative vs eager rebalancing - Quiz 6medium Consumers - Offset management - Quiz 13medium Consumers - Why consumers process messages - Quiz 13medium Kafka Basics and Event Streaming - Message broker architecture - Quiz 7medium Kafka Basics and Event Streaming - Event streaming concept - Quiz 6medium Kafka Cluster Architecture - ZooKeeper role (and KRaft replacement) - Quiz 11easy Producers - Acknowledgment modes (acks=0, 1, all) - Quiz 5medium Producers - Producer retries and idempotency - Quiz 2easy Topics and Partitions - Partition ordering guarantees - Quiz 14medium