# `PhoenixMicro.Middleware.Idempotency`
[🔗](https://github.com/iamkanishka/phoenix_micro/blob/v1.0.0/lib/phoenix_micro/middleware.ex#L234)

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
