0
0
Kafkadevops~10 mins

Acknowledgment modes (acks=0, 1, all) 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 set the acknowledgment mode to no acknowledgments (acks=0).

Kafka
props.put("acks", "[1]");
Drag options to blanks, or click blank then click option'
A0
B1
Call
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1' or 'all' instead of '0' for no acknowledgments.
2fill in blank
medium

Complete the code to set the acknowledgment mode to wait for leader acknowledgment (acks=1).

Kafka
props.put("acks", "[1]");
Drag options to blanks, or click blank then click option'
A1
B0
Call
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing '1' with 'all' or '0'.
3fill in blank
hard

Fix the error in the code to set acknowledgment mode to wait for all replicas (acks=all).

Kafka
props.put("acks", "[1]");
Drag options to blanks, or click blank then click option'
A1
B0
Ctrue
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Using boolean or numeric values instead of the string 'all'.
4fill in blank
hard

Fill both blanks to create a producer configuration with acks set to wait for leader and retries set to 3.

Kafka
props.put("acks", "[1]");
props.put("retries", [2]);
Drag options to blanks, or click blank then click option'
A1
B0
C3
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up acknowledgment modes or using string instead of integer for retries.
5fill in blank
hard

Fill all three blanks to configure a producer with acks set to all, retries set to 5, and enable idempotence.

Kafka
props.put("acks", "[1]");
props.put("retries", [2]);
props.put("enable.idempotence", [3]);
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C5
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect types or values for these settings.