Bird
0
0

A developer sets props.put("acks", "2") in Kafka producer. What is the issue with this configuration?

medium📝 Debug Q6 of 15
Kafka - Producers
A developer sets props.put("acks", "2") in Kafka producer. What is the issue with this configuration?
A"2" is not a valid acks value; only 0, 1, or all are valid.
BIt means wait for two replicas, which is valid and safe.
CIt causes the producer to ignore acknowledgments.
DIt sets acks to leader only.
Step-by-Step Solution
Solution:
  1. Step 1: Check valid acks values

    Kafka only accepts acks values as "0", "1", or "all" (or "-1" as alias).
  2. Step 2: Analyze the invalid "2" value

    Setting "2" is invalid and will cause configuration errors or fallback to default.
  3. Final Answer:

    "2" is not a valid acks value; only 0, 1, or all are valid. -> Option A
  4. Quick Check:

    Valid acks: 0, 1, all only [OK]
Quick Trick: acks accepts only 0, 1, or all strings [OK]
Common Mistakes:
  • Assuming numeric values other than 0 or 1 are valid
  • Confusing acks with min.insync.replicas
  • Expecting '2' to mean two replicas

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes