Bird
0
0

Given this Kafka producer config snippet:

medium📝 Predict Output Q4 of 15
Kafka - Producers
Given this Kafka producer config snippet:
props.put("compression.type", "lz4");
props.put("batch.size", 16384);

What is the expected effect on message sending?
AMessages are sent uncompressed due to batch size
BProducer will throw a configuration error
CMessages are compressed using gzip regardless
DMessages are compressed using lz4 before sending
Step-by-Step Solution
Solution:
  1. Step 1: Analyze compression.type setting

    Setting "compression.type" to "lz4" means messages will be compressed with lz4 codec.
  2. Step 2: Understand batch.size effect

    Batch size controls message batch size but does not disable compression.
  3. Final Answer:

    Messages are compressed using lz4 before sending -> Option D
  4. Quick Check:

    compression.type = lz4 means lz4 compression [OK]
Quick Trick: compression.type controls codec, batch.size does not disable compression [OK]
Common Mistakes:
  • Assuming batch.size disables compression
  • Confusing gzip with lz4
  • Expecting config error incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes