# Guaranteed Delivery

> Messages survive system crashes — broker persists them until they are successfully delivered.

- **Category**: Integration
- **Subcategory**: Message Channels
- **Canonical URL**: https://designpattern.fyi/patterns/guaranteed_delivery/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Bank transfer initiated — TransferRequested message published to a guaranteed-delivery queue backed by a 3-replica Kafka cluster. Producer only gets ACK after all 3 replicas confirm persistence. Even if one broker node crashes, the message survives on the other two. Transfer will be processed.





## Trade-offs


### Advantages

- Zero message loss — every accepted message is eventually delivered

- Survives broker restarts, crashes, and single-node failures

- Foundation of reliable messaging for financial, healthcare, and compliance systems

- At-least-once delivery semantics — pair with Idempotent Receiver to handle duplicates




### Considerations & Drawbacks

- Disk persistence adds write latency vs in-memory messaging

- Replication adds network overhead and storage cost

- At-least-once means duplicates are possible — consumer must be idempotent

- Higher operational cost — durable storage and replication infrastructure required







---
**Reference**: [Original Source](https://www.enterpriseintegrationpatterns.com/patterns/messaging/GuaranteedMessaging.html)

