# Content-Based Router

> Read what is in the message and send it where it belongs based on its content.

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

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Insurance claims routing — a ClaimSubmitted message is routed based on claimType field. AUTO claims go to auto-claims-service, HEALTH to health-claims-service, PROPERTY to property-claims-service. Same message, three destinations based on content.





## Trade-offs


### Advantages

- Routes based on actual business data — not just message metadata

- Enables a single channel to serve multiple downstream services

- Centralizes conditional routing in one auditable component

- Rules are explicit and easy to document




### Considerations & Drawbacks

- Router must understand message structure — coupling between router and schema

- Complex content-based rules become hard to maintain

- Schema changes in payload require router rule updates

- Performance cost of payload parsing vs header-only routing







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

