Bird
0
0

Given this Kafka producer config snippet:

medium📝 Predict Output Q13 of 15
Kafka - Performance Tuning
Given this Kafka producer config snippet:
props.put("batch.size", 16384);
props.put("linger.ms", 5);
props.put("acks", "all");

What is the expected effect on message sending?
AMessages batch up to 16KB or wait 5ms before sending, with full acknowledgment.
BMessages are compressed automatically before sending.
CMessages are sent immediately without batching.
DProducer waits for only one replica acknowledgment.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze batch.size and linger.ms

    Batch size 16384 bytes means messages batch up to 16KB or linger 5ms before sending.
  2. Step 2: Understand acks setting

    acks=all means producer waits for all replicas to confirm, ensuring durability.
  3. Final Answer:

    Messages batch up to 16KB or wait 5ms before sending, with full acknowledgment. -> Option A
  4. Quick Check:

    batch.size + linger.ms + acks=all = Messages batch up to 16KB or wait 5ms before sending, with full acknowledgment. [OK]
Quick Trick: Batch size + linger.ms controls send timing, acks controls durability [OK]
Common Mistakes:
MISTAKES
  • Assuming messages send immediately ignoring linger.ms
  • Confusing acks=all with acks=1
  • Thinking compression happens automatically without config

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes