Bird
0
0

Consider the following Kafka client configuration snippet:

medium📝 Predict Output Q4 of 15
Kafka - Security
Consider the following Kafka client configuration snippet:
props.put("security.protocol", "SASL_PLAINTEXT");
props.put("sasl.mechanism", "PLAIN");
props.put("sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"admin\" password=\"admin123\";");
System.out.println(props.get("security.protocol"));

What will be the output of the print statement?
ASASL_PLAINTEXT
BPLAINTEXT
CSASL_SSL
DPLAIN
Step-by-Step Solution
Solution:
  1. Step 1: Identify the property being printed

    The code prints the value of the property "security.protocol".
  2. Step 2: Check the assigned value

    From the snippet, "security.protocol" is set to "SASL_PLAINTEXT".
  3. Final Answer:

    SASL_PLAINTEXT -> Option A
  4. Quick Check:

    Property value matches printed output [OK]
Quick Trick: Prints exact value of 'security.protocol' property [OK]
Common Mistakes:
MISTAKES
  • Confusing 'security.protocol' with 'sasl.mechanism'
  • Assuming print outputs the mechanism instead of protocol

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes