Bird
0
0

Which of the following is the correct syntax to schedule a punctuator every 10 seconds in Kafka Streams Processor API?

easy📝 Syntax Q3 of 15
Kafka - Advanced Stream Processing
Which of the following is the correct syntax to schedule a punctuator every 10 seconds in Kafka Streams Processor API?
Acontext.schedule(Duration.ofMinutes(10), PunctuationType.WALL_CLOCK_TIME, punctuator);
Bcontext.schedule(10, TimeUnit.SECONDS, punctuator);
Ccontext.schedule(Duration.ofMillis(5000), PunctuationType.STREAM_TIME, punctuator);
Dcontext.schedule(Duration.ofSeconds(10), PunctuationType.WALL_CLOCK_TIME, punctuator);
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct method signature

    The ProcessorContext.schedule method requires Duration, PunctuationType, and a Punctuator callback.
  2. Step 2: Check the correct Duration and PunctuationType

    Duration.ofSeconds(10) and PunctuationType.WALL_CLOCK_TIME correctly schedule every 10 seconds based on wall clock time.
  3. Final Answer:

    context.schedule(Duration.ofSeconds(10), PunctuationType.WALL_CLOCK_TIME, punctuator); -> Option D
  4. Quick Check:

    Correct schedule syntax = context.schedule(Duration.ofSeconds(10), PunctuationType.WALL_CLOCK_TIME, punctuator); [OK]
Quick Trick: Use Duration and PunctuationType enums for scheduling [OK]
Common Mistakes:
  • Using deprecated or incorrect method signatures
  • Mixing STREAM_TIME with wall clock intervals
  • Incorrect time units in Duration

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes