Bird
Raised Fist0

Which Kafka producer configuration enables at-most-once delivery?

easy📝 Syntax Q12 of Q15
Kafka - Message Delivery Semantics

Which Kafka producer configuration enables at-most-once delivery?

producer = KafkaProducer(acks=?, retries=? )
A<code>acks=all</code>, <code>retries=5</code>
B<code>acks=0</code>, <code>retries=0</code>
C<code>acks=1</code>, <code>retries=3</code>
D<code>acks=all</code>, <code>retries=0</code>
Step-by-Step Solution
Solution:
  1. Step 1: Identify settings for at-most-once

    At-most-once requires no retries and no acknowledgments, so acks=0 and retries=0 are needed.
  2. Step 2: Check other options

    Other options enable retries or acknowledgments, which allow retries and possible duplicates, not at-most-once.
  3. Final Answer:

    acks=0, retries=0 -> Option B
  4. Quick Check:

    acks=0 & retries=0 = at-most-once [OK]
Quick Trick: Set acks and retries to zero for at-most-once [OK]
Common Mistakes:
MISTAKES
  • Setting retries > 0 allows retries, not at-most-once
  • Using acks=all causes waiting for confirmation
  • Confusing acks=1 with acks=0

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes