Bird
0
0

Which of the following is the correct way to schedule a punctuator in Kafka Streams?

easy📝 Syntax Q12 of 15
Kafka - Advanced Stream Processing
Which of the following is the correct way to schedule a punctuator in Kafka Streams?
Acontext.schedule(Duration.ofSeconds(10), PunctuationType.WALL_CLOCK_TIME, callback)
Bcontext.schedule(10, TimeUnit.SECONDS, callback)
Ccontext.setTimer(10, callback)
Dcontext.runEvery(10, callback)
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct method signature

    The Kafka Streams API uses context.schedule() with Duration, PunctuationType, and callback.
  2. Step 2: Match the correct syntax

    context.schedule(Duration.ofSeconds(10), PunctuationType.WALL_CLOCK_TIME, callback) matches the correct method call with Duration and PunctuationType.
  3. Final Answer:

    context.schedule(Duration.ofSeconds(10), PunctuationType.WALL_CLOCK_TIME, callback) -> Option A
  4. Quick Check:

    Correct schedule syntax = context.schedule(Duration.ofSeconds(10), PunctuationType.WALL_CLOCK_TIME, callback) [OK]
Quick Trick: Use context.schedule with Duration and PunctuationType [OK]
Common Mistakes:
MISTAKES
  • Using incorrect method names like setTimer or runEvery
  • Passing integers instead of Duration objects
  • Omitting PunctuationType argument

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes