Bird
0
0

If a Kafka consumer has fetch.min.bytes set to 50000 and fetch.max.wait.ms set to 100, what happens when less than 50000 bytes are available?

medium📝 Predict Output Q5 of 15
Kafka - Performance Tuning
If a Kafka consumer has fetch.min.bytes set to 50000 and fetch.max.wait.ms set to 100, what happens when less than 50000 bytes are available?
AConsumer throws an error due to insufficient data.
BConsumer immediately returns whatever data is available.
CConsumer waits up to 100 ms for more data before returning.
DConsumer increases fetch.min.bytes automatically.
Step-by-Step Solution
Solution:
  1. Step 1: Understand fetch.min.bytes and fetch.max.wait.ms

    fetch.min.bytes sets minimum data size to fetch; fetch.max.wait.ms is max wait time for that data.
  2. Step 2: Behavior when data is less than fetch.min.bytes

    Consumer waits up to fetch.max.wait.ms for more data before returning smaller batch.
  3. Final Answer:

    Consumer waits up to 100 ms for more data before returning. -> Option C
  4. Quick Check:

    fetch.max.wait.ms = max wait time for min bytes [OK]
Quick Trick: Consumer waits max wait ms if min bytes not met [OK]
Common Mistakes:
  • Assuming immediate return regardless of min bytes
  • Expecting error on insufficient data
  • Thinking fetch.min.bytes auto-adjusts

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes