Complete the code to set the acknowledgment mode to no acknowledgments (acks=0).
props.put("acks", "[1]");
Setting acks to 0 means the producer does not wait for any acknowledgment from the broker.
Complete the code to set the acknowledgment mode to wait for leader acknowledgment (acks=1).
props.put("acks", "[1]");
Setting acks to 1 means the producer waits for the leader broker to acknowledge the message.
Fix the error in the code to set acknowledgment mode to wait for all replicas (acks=all).
props.put("acks", "[1]");
The correct value to wait for all replicas is the string "all".
Fill both blanks to create a producer configuration with acks set to wait for leader and retries set to 3.
props.put("acks", "[1]"); props.put("retries", [2]);
Setting acks to 1 waits for leader acknowledgment, and retries to 3 allows three retry attempts.
Fill all three blanks to configure a producer with acks set to all, retries set to 5, and enable idempotence.
props.put("acks", "[1]"); props.put("retries", [2]); props.put("enable.idempotence", [3]);
Setting acks to all waits for all replicas, retries to 5 allows five retries, and enable.idempotence to true ensures exactly-once delivery.