# Composed Message Processor

> Process each item of a composite message differently, then reassemble the results.

- **Category**: Integration
- **Subcategory**: Message Routing
- **Canonical URL**: https://designpattern.fyi/patterns/composed_message_processor/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Multi-category cart checkout — cart contains electronics, clothing, and a digital download. Composed Message Processor splits by category, routes electronics to warehouse-fulfillment, clothing to fashion-fulfillment, digital to download-service. Aggregates shipping ETAs into one unified checkout response.





## Trade-offs


### Advantages

- Handles heterogeneous item types in one composite flow

- Each processor stays focused on its item type

- Parallel processing of different item types

- Reuses Splitter, Router, and Aggregator patterns — no custom invention




### Considerations & Drawbacks

- Orchestration complexity — multiple patterns working together

- Partial failures in one item type can block the whole aggregation

- Debugging requires tracing across multiple processors

- Correlation management across split-route-aggregate is non-trivial







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

