Bird
0
0

Given this Kafka producer config snippet:

medium📝 Predict Output Q4 of 15
Kafka - Performance Tuning
Given this Kafka producer config snippet:
buffer.memory=33554432
batch.size=16384
linger.ms=5
What happens if the producer tries to send messages faster than the buffer can hold?
AThe producer blocks until buffer space is available
BMessages are dropped silently
CThe producer throws an exception immediately
DMessages are sent without buffering
Step-by-Step Solution
Solution:
  1. Step 1: Understand buffer.memory and batch.size roles

    The buffer.memory limits total buffer size; batch.size limits batch size. If buffer is full, the producer must wait.
  2. Step 2: Behavior when buffer is full

    By default, the producer blocks (up to max.block.ms) until buffer space frees up; it does not drop messages or throw immediately.
  3. Final Answer:

    The producer blocks until buffer space is available -> Option A
  4. Quick Check:

    Full buffer causes blocking, not dropping [OK]
Quick Trick: Full buffer causes producer to block, not drop messages [OK]
Common Mistakes:
  • Assuming messages drop silently
  • Expecting immediate exceptions
  • Thinking buffering is bypassed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes