Bird
0
0

Given a Kafka consumer subscribed to topic 'logs' with 2 partitions, what happens if the consumer group has 3 consumers?

medium📝 Predict Output Q4 of 15
Kafka - Basics and Event Streaming
Given a Kafka consumer subscribed to topic 'logs' with 2 partitions, what happens if the consumer group has 3 consumers?
AOne consumer will be idle without assigned partitions.
BAll consumers will receive all messages from both partitions.
CKafka will create an extra partition for the third consumer.
DThe consumer group will fail to start.
Step-by-Step Solution
Solution:
  1. Step 1: Understand partition assignment

    Kafka assigns partitions to consumers in a group; each partition is consumed by only one consumer.
  2. Step 2: Analyze consumer count vs partitions

    With 2 partitions and 3 consumers, only 2 consumers get partitions; 1 consumer remains idle.
  3. Final Answer:

    One consumer will be idle without assigned partitions. -> Option A
  4. Quick Check:

    Consumers > partitions = idle consumers [OK]
Quick Trick: Consumers can't outnumber partitions for active assignment [OK]
Common Mistakes:
  • Assuming all consumers get all messages
  • Thinking Kafka auto-creates partitions
  • Believing consumer group fails with extra consumers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes