# Message Router

> Inspect a message and send it to the right channel — routing logic in one place.

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

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Order routing — all orders arrive on one channel. Router sends US orders to us-fulfillment, EU orders to eu-fulfillment, and priority orders to premium-fulfillment. Fulfillment services have zero knowledge of each other.





## Trade-offs


### Advantages

- Centralizes routing logic — one place to change routing rules

- Decouples producers from consumer addresses

- Clean separation of routing concern from processing concern

- Easy to add new routing rules without touching producers or consumers




### Considerations & Drawbacks

- Router becomes a single point of failure — must be HA

- Complex routing logic can make the router a bottleneck

- Centralized routing contradicts fully decentralized event-driven designs

- Testing complex routing tables is tedious







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

