Bird
0
0

If a Kafka producer has batch.size set to 16384 bytes and linger.ms set to 100 ms, what happens when 10 KB of messages arrive within 50 ms?

medium📝 Predict Output Q5 of 15
Kafka - Producers
If a Kafka producer has batch.size set to 16384 bytes and linger.ms set to 100 ms, what happens when 10 KB of messages arrive within 50 ms?
AMessages are sent immediately after 50 ms
BMessages are sent only when batch size reaches 16 KB
CMessages are dropped because batch is not full
DMessages wait up to 100 ms or until batch size is reached
Step-by-Step Solution
Solution:
  1. Step 1: Understand batch.size and linger.ms roles

    Batch size is 16 KB, but only 10 KB arrived, so batch is not full yet.
  2. Step 2: Apply linger.ms timing

    Producer waits up to 100 ms before sending batch even if batch is not full.
  3. Final Answer:

    Messages wait up to 100 ms or until batch size is reached -> Option D
  4. Quick Check:

    linger.ms delays send if batch not full [OK]
Quick Trick: linger.ms delays send until timeout or batch full [OK]
Common Mistakes:
  • Assuming messages send immediately after arrival
  • Thinking batch must be full to send
  • Believing messages get dropped if batch not full

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes