PhoenixMicro.Middleware.Idempotency (PhoenixMicro v1.0.0)

Copy Markdown View Source

Deduplication middleware. Checks whether a message ID has already been successfully processed using a configured PhoenixMicro.IdempotencyStore.

Skips processing (returns :ok) if the message was already processed. Marks the message as processed after successful handling.

Configure the store in your application config:

config :phoenix_micro,
  idempotency_store: MyApp.IdempotencyStore  # implements the behaviour

Built-in ETS store

A simple ETS-backed store is provided for development/testing:

idempotency_store: PhoenixMicro.Middleware.Idempotency.ETSStore