Enterprise Integration Patterns
Overview
Enterprise Integration Patterns (EIP), catalogued by Gregor Hohpe and Bobby Woolf, define a vocabulary of 65 patterns for designing robust, asynchronous messaging systems. The patterns describe how to connect applications, transform data in flight, route messages intelligently, and manage messaging infrastructure -- all while keeping systems loosely coupled and independently deployable.
The book organises patterns around the pipes-and-filters architectural style: messages flow through a series of processing steps (filters) connected by channels (pipes).
Pattern Categories
┌─────────────────────────────────────────────────────────────────┐
│ Enterprise Integration Patterns │
├───────────────┬───────────────┬───────────────┬─────────────────┤
│ Messaging │ Message │ Message │ Message │
│ Channels │ Construction │ Routing │ Transformation │
│ │ │ │ │
│ How messages │ How messages │ How messages │ How messages │
│ travel │ are built │ are directed │ are reshaped │
├───────────────┴───────────────┴───────────────┴─────────────────┤
│ Messaging Endpoints │ System Management │
│ │ │
│ How applications connect │ How to monitor, test, and │
│ to the messaging system │ control the messaging system │
└───────────────────────────────┴─────────────────────────────────┘
Pipes-and-Filters Architecture
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ Source │───>│ Filter A │───>│ Filter B │───>│ Sink │
│ (Producer)│ │(Transform│ │ (Route) │ │(Consumer)│
└──────────┘ └──────────┘ └──────────┘ └──────────┘
pipe pipe pipe
(channel) (channel) (channel)
Each filter performs a single processing step (validate, enrich, transform, route). Each pipe is a message channel connecting one filter to the next. This architecture provides:
- Composability -- combine simple filters into complex workflows.
- Replaceability -- swap a filter without touching others.
- Scalability -- scale individual filters independently.
- Testability -- test each filter in isolation.
When to Use Messaging vs. Direct Calls
| Concern |
Direct / Synchronous Calls |
Messaging / Asynchronous |
| Coupling |
Caller must know callee's address and API |
Sender only knows the channel |
| Availability |
Callee must be running |
Callee can be offline; messages queue |
| Latency |
Immediate response required |
Eventual response acceptable |
| Throughput |
Limited by slowest participant |
Buffer with queues; scale consumers |
| Error handling |
Caller handles errors in real time |
Dead-letter channels, retries, compensation |
| Complexity |
Simple for 1:1 interactions |
Worth it when >2 participants or reliability matters |
Rule of thumb: Start synchronous. Move to messaging when you need temporal decoupling, load levelling, reliable delivery, or fan-out to multiple consumers.
Pattern Selection Guide
| Problem |
Pattern Category |
Key Patterns |
| How do I send a message from A to B? |
Messaging Channels |
Point-to-Point Channel, Channel Adapter |
| How do I notify many subscribers? |
Messaging Channels |
Publish-Subscribe Channel |
| What goes inside a message? |
Message Construction |
Command Message, Event Message, Document Message |
| How do I correlate request and reply? |
Message Construction |
Correlation Identifier, Return Address |
| How do I route to the right consumer? |
Message Routing |
Content-Based Router, Recipient List |
| How do I split and reassemble? |
Message Routing |
Splitter, Aggregator |
| How do I orchestrate a multi-step flow? |
Message Routing |
Process Manager, Routing Slip |
| How do I reshape data between systems? |
Message Transformation |
Content Enricher, Normalizer, Canonical Data Model |
| How do I reduce message size? |
Message Transformation |
Claim Check, Content Filter |
| How do I consume messages reliably? |
Messaging Endpoints |
Competing Consumers, Idempotent Receiver |
| How do I monitor and debug? |
System Management |
Wire Tap, Message Store, Control Bus |
Reference Implementations
| Technology |
Language / Platform |
Strengths |
| Apache Camel |
Java / JVM |
Broadest connector ecosystem; DSL routes map 1:1 to EIP |
| Spring Integration |
Java / Spring |
Deep Spring ecosystem integration; annotation-driven |
| MassTransit |
C# / .NET |
First-class saga support; RabbitMQ & Azure Service Bus transports |
| NServiceBus |
C# / .NET |
Commercial-grade; strong tooling and monitoring |
| MediatR |
C# / .NET |
In-process mediator; great for CQRS without infrastructure |
| Azure Service Bus |
Cloud (Azure) |
Managed broker; topics, subscriptions, sessions |
| RabbitMQ |
Any (AMQP) |
Lightweight broker; exchanges map to routing patterns |
| Apache Kafka |
Any |
Log-based streaming; high throughput; replay capability |
Best Practices
- Learn the pattern language before choosing a framework -- the vocabulary transcends any single implementation.
- Prefer idempotent message handlers; at-least-once delivery is the norm.
- Design messages as immutable, self-describing contracts with schema versioning.
- Keep channels focused on a single data type or purpose (Datatype Channel).
- Use Dead Letter Channels for every queue -- never silently drop messages.
- Instrument messaging with Wire Taps and Message Stores from day one; debugging async flows without observability is painful.
- Start with the simplest topology (point-to-point) and evolve toward pub-sub or content-based routing only when the need is proven.
1---2name: integration-patterns3description: Use when designing or evaluating enterprise integration architectures based on Hohpe & Woolf's Enterprise Integration Patterns. USE FOR: Enterprise Integration Patterns, messaging architecture, choosing integration patterns, pipes and filters, message-oriented middleware DO NOT USE FOR: specific pattern implementations in code (use sub-skills), API design (use dev/backend/api-design), event sourcing (use dev/architecture/event-driven)4license: MIT5---67# Enterprise Integration Patterns89## Overview10Enterprise Integration Patterns (EIP), catalogued by Gregor Hohpe and Bobby Woolf, define a vocabulary of 65 patterns for designing robust, asynchronous messaging systems. The patterns describe how to connect applications, transform data in flight, route messages intelligently, and manage messaging infrastructure -- all while keeping systems loosely coupled and independently deployable.1112The book organises patterns around the pipes-and-filters architectural style: messages flow through a series of processing steps (filters) connected by channels (pipes).1314## Pattern Categories1516```17┌─────────────────────────────────────────────────────────────────┐18│ Enterprise Integration Patterns │19├───────────────┬───────────────┬───────────────┬─────────────────┤20│ Messaging │ Message │ Message │ Message │21│ Channels │ Construction │ Routing │ Transformation │22│ │ │ │ │23│ How messages │ How messages │ How messages │ How messages │24│ travel │ are built │ are directed │ are reshaped │25├───────────────┴───────────────┴───────────────┴─────────────────┤26│ Messaging Endpoints │ System Management │27│ │ │28│ How applications connect │ How to monitor, test, and │29│ to the messaging system │ control the messaging system │30└───────────────────────────────┴─────────────────────────────────┘31```3233## Pipes-and-Filters Architecture3435```36┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐37│ Source │───>│ Filter A │───>│ Filter B │───>│ Sink │38│ (Producer)│ │(Transform│ │ (Route) │ │(Consumer)│39└──────────┘ └──────────┘ └──────────┘ └──────────┘40 pipe pipe pipe41 (channel) (channel) (channel)42```4344Each **filter** performs a single processing step (validate, enrich, transform, route). Each **pipe** is a message channel connecting one filter to the next. This architecture provides:45- **Composability** -- combine simple filters into complex workflows.46- **Replaceability** -- swap a filter without touching others.47- **Scalability** -- scale individual filters independently.48- **Testability** -- test each filter in isolation.4950## When to Use Messaging vs. Direct Calls5152| Concern | Direct / Synchronous Calls | Messaging / Asynchronous |53|---------|---------------------------|--------------------------|54| Coupling | Caller must know callee's address and API | Sender only knows the channel |55| Availability | Callee must be running | Callee can be offline; messages queue |56| Latency | Immediate response required | Eventual response acceptable |57| Throughput | Limited by slowest participant | Buffer with queues; scale consumers |58| Error handling | Caller handles errors in real time | Dead-letter channels, retries, compensation |59| Complexity | Simple for 1:1 interactions | Worth it when >2 participants or reliability matters |6061**Rule of thumb:** Start synchronous. Move to messaging when you need temporal decoupling, load levelling, reliable delivery, or fan-out to multiple consumers.6263## Pattern Selection Guide6465| Problem | Pattern Category | Key Patterns |66|---------|-----------------|--------------|67| How do I send a message from A to B? | Messaging Channels | Point-to-Point Channel, Channel Adapter |68| How do I notify many subscribers? | Messaging Channels | Publish-Subscribe Channel |69| What goes inside a message? | Message Construction | Command Message, Event Message, Document Message |70| How do I correlate request and reply? | Message Construction | Correlation Identifier, Return Address |71| How do I route to the right consumer? | Message Routing | Content-Based Router, Recipient List |72| How do I split and reassemble? | Message Routing | Splitter, Aggregator |73| How do I orchestrate a multi-step flow? | Message Routing | Process Manager, Routing Slip |74| How do I reshape data between systems? | Message Transformation | Content Enricher, Normalizer, Canonical Data Model |75| How do I reduce message size? | Message Transformation | Claim Check, Content Filter |76| How do I consume messages reliably? | Messaging Endpoints | Competing Consumers, Idempotent Receiver |77| How do I monitor and debug? | System Management | Wire Tap, Message Store, Control Bus |7879## Reference Implementations8081| Technology | Language / Platform | Strengths |82|-----------|-------------------|-----------|83| **Apache Camel** | Java / JVM | Broadest connector ecosystem; DSL routes map 1:1 to EIP |84| **Spring Integration** | Java / Spring | Deep Spring ecosystem integration; annotation-driven |85| **MassTransit** | C# / .NET | First-class saga support; RabbitMQ & Azure Service Bus transports |86| **NServiceBus** | C# / .NET | Commercial-grade; strong tooling and monitoring |87| **MediatR** | C# / .NET | In-process mediator; great for CQRS without infrastructure |88| **Azure Service Bus** | Cloud (Azure) | Managed broker; topics, subscriptions, sessions |89| **RabbitMQ** | Any (AMQP) | Lightweight broker; exchanges map to routing patterns |90| **Apache Kafka** | Any | Log-based streaming; high throughput; replay capability |9192## Best Practices93- Learn the pattern language before choosing a framework -- the vocabulary transcends any single implementation.94- Prefer idempotent message handlers; at-least-once delivery is the norm.95- Design messages as immutable, self-describing contracts with schema versioning.96- Keep channels focused on a single data type or purpose (Datatype Channel).97- Use Dead Letter Channels for every queue -- never silently drop messages.98- Instrument messaging with Wire Taps and Message Stores from day one; debugging async flows without observability is painful.99- Start with the simplest topology (point-to-point) and evolve toward pub-sub or content-based routing only when the need is proven.