Bird
0
0

What is wrong with this Kafka consumer configuration for static group membership?

medium📝 Debug Q6 of 15
Kafka - Consumer Groups

What is wrong with this Kafka consumer configuration for static group membership?

props.put("group.instance.id", "consumer-1");
props.put("group.instance.id", "consumer-1");
AMissing 'group.id' property to identify the consumer group
BDuplicate keys for 'group.instance.id' will cause the last value to override the first
C'group.instance.id' values must be numeric, not strings
DStatic membership requires setting 'enable.auto.commit' to false
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the configuration snippet

    The snippet sets 'group.instance.id' twice with the same key.
  2. Step 2: Understand Java Properties behavior

    In Java Properties, duplicate keys overwrite previous values, so only the last 'group.instance.id' will be used.
  3. Final Answer:

    Duplicate keys for 'group.instance.id' will cause the last value to override the first -> Option B
  4. Quick Check:

    Check for duplicate keys in Properties [OK]
Quick Trick: Avoid duplicate keys in Properties to prevent overwriting [OK]
Common Mistakes:
  • Assuming both 'group.instance.id' values are used simultaneously
  • Forgetting to set 'group.id' for the consumer group
  • Believing 'group.instance.id' must be numeric

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes