Delivery Semantics & Reliability Flashcards

(4 cards)

1
Q

What are Kafka’s message delivery semantics?

A

Three delivery semantics: At-most-once (may lose messages), At-least-once (may duplicate messages), Exactly-once (each message processed once, requires Kafka Streams or transactions).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to achieve At-least-once delivery?

A

Producer: Set acks=all and retries>0. Consumer: Commit offsets only after processing messages. Risk: If consumer crashes after processing but before commit, messages are reprocessed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to achieve At-most-once delivery?

A

Producer: Set acks=0 or low retries. Consumer: Commit offsets before processing messages. Risk: If consumer crashes during processing, messages are lost.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to achieve Exactly-once delivery?

A

Use Kafka’s idempotent producer (prevents duplicate sends) and transactional API with read_committed isolation level. Or use Kafka Streams with exactly-once processing guarantees.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly