# Document Message

> Ship a complete data record as a message — receiver does whatever it wants with it.

- **Category**: Integration
- **Subcategory**: Message Construction
- **Canonical URL**: https://designpattern.fyi/patterns/document_message/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Product catalog sync — every time a product is updated, a full ProductDocument message is published containing all product fields. Downstream search index, recommendation engine, and mobile API each consume and process it independently without calling back to the product service.





## Trade-offs


### Advantages

- Receiver is fully autonomous — no callbacks or additional fetches needed

- Self-contained = easier to replay, debug, and audit

- Works well for data sync and replication use cases

- Decouples processing time from data availability




### Considerations & Drawbacks

- Large payloads can overwhelm brokers — use Claim Check for big documents

- Data can be stale by the time it is consumed (eventual consistency)

- Schema evolution is tricky — all consumers must handle new/removed fields

- Redundant data if multiple consumers only need a slice (pair with Content Filter)







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

