Bird
0
0

You set buffer.memory=1024 and batch.size=2048 in Kafka producer config. What issue will occur?

medium📝 Debug Q14 of 15
Kafka - Performance Tuning
You set buffer.memory=1024 and batch.size=2048 in Kafka producer config. What issue will occur?
AProducer will throw a configuration error on startup
BNo issue; Kafka adjusts batch.size automatically
CProducer will silently drop messages exceeding buffer.memory
DProducer will block or throw an error when batch.size exceeds buffer.memory
Step-by-Step Solution
Solution:
  1. Step 1: Compare batch.size and buffer.memory values

    Here, batch.size (2048) is larger than buffer.memory (1024), which is invalid.
  2. Step 2: Kafka behavior on invalid buffer sizes

    Kafka producer will block or throw an error because it cannot allocate a batch larger than total buffer memory.
  3. Final Answer:

    Producer will block or throw an error when batch.size exceeds buffer.memory -> Option D
  4. Quick Check:

    batch.size must be ≤ buffer.memory [OK]
Quick Trick: batch.size cannot be bigger than buffer.memory [OK]
Common Mistakes:
  • Assuming Kafka auto-corrects batch.size
  • Expecting silent message drops
  • Thinking config error happens at startup

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes