Explore the behavior
Define the operation identity
Choose a key stable across retries of one intended operation. Validate its business identifier before using it. This admission-only example records no payment or other external effect:admitted: true; a repeated call while the key exists returns false. The admission key is stored durably per instance. Acquiring it requires write-capable execution.
Complete the business design
- Record the intended operation and its correlation ID durably.
- Send the same idempotency key through the destination’s supported contract when available.
- Record the destination receipt and confirmed outcome.
- On repeated delivery, return or reconcile the existing operation rather than assuming the effect failed.
Expiry and release
Protection lasts until TTL expiry or explicit release. Choose TTL from the possible redelivery window, and retain business evidence independently. Do not release the key from a genericcatch or finally: an exception may follow a committed effect. Release only when no effect occurred or rollback is confirmed and the key still belongs to this attempt. Late cleanup after expiry can otherwise remove another attempt’s key.
Read retry and uncertainty, then the exact acquireIdempotencyKey() and releaseIdempotencyKey() contracts.
An Event occurrence ID changes on operator Replay. Use a business operation identity when protection must survive new occurrences and attempts.
