0
0
Kafkadevops~10 mins

Idempotent producer 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 enable idempotence in the Kafka producer configuration.

Kafka
Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
props.put("[1]", "true");
Drag options to blanks, or click blank then click option'
Aretries
Backs
Cmax.in.flight.requests.per.connection
Denable.idempotence
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'acks' instead of 'enable.idempotence' to enable idempotence.
Setting 'retries' to true, which is invalid.
Confusing 'max.in.flight.requests.per.connection' with the idempotence setting.
2fill in blank
medium

Complete the code to set the maximum number of retries for the idempotent producer.

Kafka
props.put("[1]", 5);
Drag options to blanks, or click blank then click option'
Aretries
Benable.idempotence
Cacks
Dmax.in.flight.requests.per.connection
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'acks' instead of 'retries' to set retry count.
Setting 'enable.idempotence' to a number instead of a boolean.
Confusing 'max.in.flight.requests.per.connection' with retry count.
3fill in blank
hard

Fix the error in the code to limit the number of in-flight requests for idempotent producer.

Kafka
props.put("max.in.flight.requests.per.connection", [1]);
Drag options to blanks, or click blank then click option'
A5
B"5"
C"true"
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the number as a string instead of an integer.
Using boolean values instead of an integer.
Confusing this setting with 'enable.idempotence'.
4fill in blank
hard

Fill both blanks to configure the producer for idempotent delivery with correct acknowledgments.

Kafka
props.put("[1]", "true");
props.put("[2]", "all");
Drag options to blanks, or click blank then click option'
Aenable.idempotence
Backs
Cretries
Dmax.in.flight.requests.per.connection
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing 'retries' with 'acks' in these positions.
Setting 'acks' to a boolean value instead of 'all'.
Not enabling idempotence but setting 'acks' to 'all'.
5fill in blank
hard

Fill all three blanks to complete the idempotent producer configuration with retries and in-flight request limits.

Kafka
props.put("[1]", "true");
props.put("[2]", 3);
props.put("[3]", 1);
Drag options to blanks, or click blank then click option'
Aenable.idempotence
Bretries
Cmax.in.flight.requests.per.connection
Dacks
Attempts:
3 left
💡 Hint
Common Mistakes
Setting 'acks' instead of 'max.in.flight.requests.per.connection' for the last blank.
Using string values for numeric settings.
Not enabling idempotence but setting retries and in-flight requests.