Bird
Raised Fist0

Given the following code snippet, what is the output topic name used in the topology?

medium📝 Predict Output Q4 of Q15
Kafka - Streams
Given the following code snippet, what is the output topic name used in the topology? StreamsBuilder builder = new StreamsBuilder(); KStream stream = builder.stream("input-topic"); stream.to("output-topic");
Ainput-topic
Bstream-topic
Coutput-topic
Ddefault-topic
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the stream source and sink

    The stream reads from "input-topic" and writes to "output-topic".
  2. Step 2: Identify the output topic

    The to() method specifies the output topic as "output-topic".
  3. Final Answer:

    output-topic -> Option C
  4. Quick Check:

    Output topic = output-topic [OK]
Quick Trick: to() method defines output topic [OK]
Common Mistakes:
MISTAKES
  • Confusing input topic with output topic
  • Assuming default topic is used
  • Ignoring the to() method parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes