idempotent consumer
A message or webhook handler that produces the same result whether it sees a message once or several times.
In more detail
Typically it records each event identifier it has processed, in the same transaction as the effect, and skips any it has already seen. It turns at-least-once delivery into effectively-once processing.
Related terms
- idempotency — The property of an operation that gives the same result whether you run it once or many times, because a repeat run finds nothing left to do.
- deduplication — Detecting and discarding repeated copies of the same message or request, usually by remembering identifiers already processed.
- at-least-once delivery — A delivery guarantee under which every message arrives, but some may arrive more than once.
- event ID — A unique identifier the producer puts in each event so consumers can recognise the same event if it arrives twice.
- upsert — A database write that inserts a row if it does not exist and updates it if it does, in one statement.
Taught in
- Webhooks Versus Polling — Modern API Architecture: REST, GraphQL & gRPC
- Event-Driven Architecture And Queues — Modern API Architecture: REST, GraphQL & gRPC
- Duplicates Are The Default — Apache Kafka & Event Streaming
- Idempotent Consumers And Deduplication Keys — Apache Kafka & Event Streaming