A successful delivery response tells the sender it can stop retrying that attempt. If the receiver acknowledged while the event existed only in RAM, a crash can erase it permanently. Persist the verified event and its processing state before returning success. Slow downstream work can then run outside the delivery request.
Delivery identity and business revision
Event X at revision 18 arrives again. Its ID already exists in the inbox, so the receiver acknowledges the retry without applying the renewal twice.
Why it exists
The inbox records receipt. A business revision records the state of the subscription. Two copies of one event share a delivery identity, while two different updates can have distinct identities and arrive in reverse business order. The consumer needs a policy for both cases.
View diagram · Subscription updatesAdvance with an authoritative version or reconcile with current state. Full size
Words to know
Inbox
Durable storage of received events and their processing status.
Outbox
A durable record of an outgoing action committed with the local state change.
How it works
Step through the idea, or press Play.
Step 1 of 3
Verify and persist. Verify the provider signature against the raw payload. Durably record the event under a unique provider and event ID before acknowledging receipt.
Apply once locally. In a transaction, guard the consumer’s state change with the stored event identity. If the effect is external, use a stable downstream idempotency key or an outbox and reconciliation.
Handle order separately. Duplicates and reordering are independent. Use a reliable domain revision when available, or read authoritative current state before reconciling. Test a replay of yesterday’s update after today’s renewal.
Understand it
Start here
The subscription mailroom
Treat incoming subscription updates like envelopes at a desk. Read both the envelope ID and the revision inside it. One identifies a repeated delivery and the other tells you which state is newer.
The subscription mailroom
Two different checks handle two failure modes.
Structure
Subscription updates
Subscription updates
Advance with an authoritative version or reconcile with current state.
Replay a renewal
Deliver events for revisions 18, 18 and 17 in that order. Processing should leave the subscription at 18 with one renewal effect. Then crash immediately after persisting a new event and before applying it. Recovery must find the pending event.
Marking an event done before applying its effect loses the update after a crash. Applying the effect first and marking done later risks duplication. When both live in one database, commit them together. When an effect calls another service, persist an outbox entry and deliver it using a stable downstream key. The receiving service still needs to honor that identity.
When the payload lacks a revision
Transport arrival time tells you when your server received a message. It does not prove when the business event happened. For a current-state projection, use the notification as a signal to fetch authoritative state and reconcile it. For immutable financial movements, preserve individual event identities and reconcile missing movements instead of overwriting history with one snapshot.
Track receipt and revision
Two different checks handle two failure modes.
Order by arrival
The newest delivery can carry older business state.
Summary
The whole topic in one minute.
Track durable receipt, local application and external side effects separately. Test redelivery and reversed event order as distinct failure modes.