0
0
Kafkadevops~10 mins

Punctuators for time-based triggers in Kafka - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to schedule a punctuator that triggers every 1000 milliseconds.

Kafka
context.schedule([1], PunctuationType.WALL_CLOCK_TIME, callback);
Drag options to blanks, or click blank then click option'
A100
B10000
C1000
D5000
Attempts:
3 left
💡 Hint
Common Mistakes
Using 10000 will trigger every 10 seconds, which is too long for this task.
Using 100 or 5000 will trigger too fast or too slow compared to 1 second.
2fill in blank
medium

Complete the code to use the correct PunctuationType for wall-clock time triggers.

Kafka
context.schedule(1000, [1], callback);
Drag options to blanks, or click blank then click option'
AWALL_CLOCK_TIME
BSTREAM_TIME
CPROCESSING_TIME
DEVENT_TIME
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing STREAM_TIME triggers based on stream progress, not real time.
PROCESSING_TIME is not a valid PunctuationType in Kafka Streams.
3fill in blank
hard

Fix the error in the code to correctly schedule a punctuator every 5 seconds.

Kafka
context.schedule([1], PunctuationType.WALL_CLOCK_TIME, callback);
Drag options to blanks, or click blank then click option'
A500
B10000
C50
D5000
Attempts:
3 left
💡 Hint
Common Mistakes
Using 500 triggers every 0.5 seconds, which is too frequent.
Using 10000 triggers every 10 seconds, which is too slow.
4fill in blank
hard

Fill both blanks to schedule a punctuator every 2 seconds using the correct PunctuationType.

Kafka
context.schedule([1], [2], callback);
Drag options to blanks, or click blank then click option'
A2000
BSTREAM_TIME
CWALL_CLOCK_TIME
DPROCESSING_TIME
Attempts:
3 left
💡 Hint
Common Mistakes
Using STREAM_TIME triggers based on stream progress, not real time.
Using 2000 with wrong PunctuationType will not trigger as expected.
5fill in blank
hard

Fill all three blanks to schedule a punctuator every 3 seconds that prints 'Tick' each time.

Kafka
context.schedule([1], [2], timestamp -> {
    System.out.println([3]);
});
Drag options to blanks, or click blank then click option'
A3000
BWALL_CLOCK_TIME
C"Tick"
D"Tock"
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong interval or PunctuationType.
Printing the wrong string like "Tock" instead of "Tick".