Every broker worth using delivers at least once, and every consumer that does not say how it handles that is claiming something it has not checked.
/**
* Idempotency: keyed on message id in processed_messages.
* A redelivery is a no-op. Verified by
* DuplicateDeliveryTest.
*/
final class CapturePaymentHandler { /* ... */ }
// and the ones that genuinely cannot be:
/**
* Idempotency: NONE. this handler increments a counter.
* accepted because the counter is approximate and used
* only for a dashboard. do not copy this.
*/
Writing the guarantee in a docblock on every handler took an afternoon and turned an assumption into a review item — three handlers could not answer the question, and one of them was charging cards. The second comment is the more useful pattern: an explicit, reasoned exception is fine, and an unexamined one is not.