Delivery & reliability

Idempotency

Idempotency means repeating an operation has the same intended effect as performing it once. In publishing APIs, an idempotency key can identify retries of one logical publication.

Also found under: Idempotency-Key, Deduplication

How it works

A timeout does not reveal whether the server accepted a request before the response was lost. Reusing a key lets the server recognize a retry. Keys must be scoped to one intended operation; creating a new key for every attempt removes the deduplication benefit.

In a Pubb integration

Pubb accepts an Idempotency-Key header and returns publicationId and duplicate fields. Reusing a key for different event content causes a conflict. Publication deduplication does not establish exactly-once processing in every subscriber.

Publish an event

A practical example

Publish an order event with a key derived from the saved order transition. If the response times out, retry the same content with the same key.