Bird
0
0

Given the following Kafka producer configuration:

medium📝 Predict Output Q4 of 15
Kafka - Producers
Given the following Kafka producer configuration:
{"batch.size": 32768, "linger.ms": 10}

What will happen if messages arrive slowly, one every 20 milliseconds?
AMessages are batched only when batch size reaches 32 KB
BEach message waits 20 ms before sending
CMessages are batched up to 32 KB or sent after 10 ms linger time
DEach message is sent immediately without batching
Step-by-Step Solution
Solution:
  1. Step 1: Analyze batching triggers

    Producer sends when batch reaches batch.size (32 KB) or linger.ms elapses since last append.
  2. Step 2: Apply to slow arrival rate

    Messages every 20 ms > 10 ms linger means each batch (single message) sends after 10 ms timeout.
  3. Final Answer:

    Messages are batched up to 32 KB or sent after 10 ms linger time -> Option C
  4. Quick Check:

    Send on full size or linger timeout [OK]
Quick Trick: Producer sends on batch full or linger timeout [OK]
Common Mistakes:
  • Thinking messages send immediately without linger delay
  • Ignoring message arrival timing vs linger.ms
  • Thinking batch size triggers sending regardless of linger.ms

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes