Bird
0
0

Which of the following is the correct way to set the compression.type to snappy in a Kafka producer properties file?

easy📝 Syntax Q3 of 15
Kafka - Performance Tuning
Which of the following is the correct way to set the compression.type to snappy in a Kafka producer properties file?
Aprops.put("compression.type", "snappy");
Bprops.setProperty("compression", "snappy");
Cprops.put("compress.type", "snappy");
Dprops.set("compression.type", "snappy");
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct method and key

    Kafka producer properties use props.put(key, value) and the key for compression is compression.type.
  2. Step 2: Verify correct syntax

    props.put("compression.type", "snappy"); uses correct method and key. Other options have wrong method names or keys.
  3. Final Answer:

    props.put("compression.type", "snappy"); -> Option A
  4. Quick Check:

    Use props.put with correct key [OK]
Quick Trick: Use props.put("compression.type", "snappy") [OK]
Common Mistakes:
  • Using wrong method like setProperty or set
  • Using incorrect key names
  • Missing quotes around strings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes