Bird
0
0

What will happen if a Kafka producer is configured with batch.size set to a negative value and compression.type set to 'gzip'?

medium📝 Predict Output Q5 of 15
Kafka - Performance Tuning
What will happen if a Kafka producer is configured with batch.size set to a negative value and compression.type set to 'gzip'?
AThe producer will throw a configuration error and fail to start
BMessages will be sent uncompressed with default batch size
CThe producer will ignore compression and send messages immediately
DMessages will be compressed but batching will be disabled
Step-by-Step Solution
Solution:
  1. Step 1: Validate batch.size constraints

    The batch.size must be a positive integer; negative values are invalid.
  2. Step 2: Effect on producer startup

    Kafka producer validates configs on startup and will throw an error for invalid batch.size.
  3. Final Answer:

    The producer will throw a configuration error and fail to start -> Option A
  4. Quick Check:

    Negative batch.size is invalid config [OK]
Quick Trick: Negative batch.size causes config error [OK]
Common Mistakes:
  • Assuming negative batch.size defaults to zero
  • Thinking compression.type affects batch.size validation
  • Believing producer silently ignores invalid batch.size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes