Bird
0
0

Which of the following is the correct syntax to enable SASL_SSL in Kafka client properties in Java?

easy📝 Syntax Q3 of 15
Kafka - Security
Which of the following is the correct syntax to enable SASL_SSL in Kafka client properties in Java?
Aprops.put("securityProtocol", "SASL_SSL");
Bprops.put("security.protocol", "SASL_SSL");
Cprops.setProperty("securityProtocol", "SASL_SSL");
Dprops.set("security.protocol", "SASL_SSL");
Step-by-Step Solution
Solution:
  1. Step 1: Recall Java Properties syntax

    Java Properties uses put(key, value) to set properties.
  2. Step 2: Check correct property name and method

    The property name is 'security.protocol' and method is put, so 'props.put("security.protocol", "SASL_SSL");' is correct.
  3. Final Answer:

    props.put("security.protocol", "SASL_SSL"); -> Option B
  4. Quick Check:

    Java Properties set SASL_SSL with put and correct key [OK]
Quick Trick: Use props.put("security.protocol", "SASL_SSL") in Java [OK]
Common Mistakes:
  • Using setProperty instead of put
  • Wrong property name like securityProtocol
  • Using non-existent set method
  • Incorrect casing in property key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes