Enterprise Integration Patterns
Common patterns for connecting enterprise applications and when to use each approach. A practical guide to messaging, APIs, and event-driven architectures.
Common patterns for connecting enterprise applications and when to use each approach. A practical guide to messaging, APIs, and event-driven architectures.
The simplest approach: System A connects directly to System B. If you need to connect A to C, you build another direct connection. With just a few systems, this works fine. With many systems, it becomes a tangled web of connections where changing one system can break connections to many others.
When it works: Few systems, stable interfaces, limited integration scope.
When it fails: When the number of systems grows. With N systems, you potentially need N × (N−1)/2 connections - exponential complexity.
A central integration hub manages all connections. Each system connects only to the hub, which routes and transforms messages between systems. An Enterprise Service Bus (ESB) is the common implementation of this pattern.
When it works: Many systems to integrate, need for centralised management, complex transformation requirements.
When it fails: Can become a performance bottleneck. Single point of failure. Can become expensive to license and maintain.
Systems publish events when things happen ("order placed," "customer updated") without knowing who is listening. Other systems subscribe to events they care about. This decouples producers from consumers; neither needs to know about the other.
When it works: Systems that need loose coupling, real-time requirements, scenarios where multiple systems need the same data.
When it fails: When you need synchronous request/response patterns. When eventual consistency is not acceptable.
Messages are placed in a queue by producers and consumed by a single consumer. The queue guarantees delivery and ordering, even if the consumer is temporarily unavailable. Messages wait until it is ready.
Use case: Order processing where each order must be handled exactly once by a single processor.
Publishers send messages to a topic. Multiple subscribers can listen to the topic and each receives a copy of every message. Unlike queues, messages go to all interested parties.
Use case: Customer profile updates that need to reach your marketing platform, support system, and analytics tool simultaneously.
A requester sends a message and waits for a response. This provides synchronous-like behaviour over asynchronous infrastructure; useful when you need immediate feedback.
Use case: Real-time inventory checks during order placement.
A component that inspects messages and routes them to different destinations based on content or rules. Useful when different message types need different handling.
Use case: Routing support tickets to different queues based on product category or customer tier.
Converts messages from one format to another. Your ERP speaks XML; your e-commerce platform speaks JSON. The translator sits between them, converting on the fly.
Adds information to messages that was not in the original. An order message might contain only a customer ID; the enricher looks up full customer details from your CRM before forwarding.
Removes information that the receiver does not need or should not see. Your internal order data might include profit margins that external systems should not receive.
Combines multiple related messages into a single message. Individual line items from different sources might aggregate into a complete order before processing.
Breaks a complex message into multiple simpler messages. A batch order might split into individual line items, each processed separately then rejoined.
Ensures messages are not lost even if systems fail. Typically implemented by persisting messages to disk before acknowledging receipt. If processing fails, the message can be redelivered.
Messages that cannot be processed (invalid format, no handler, repeated failures) go to a special queue for manual inspection rather than blocking normal processing or being silently discarded.
Receivers that can handle the same message multiple times without side effects. If network issues cause a message to be delivered twice, the receiver produces the same result as processing once. Essential for reliable at-least-once delivery.
When a service needs to update its database and publish a message, there is a risk of inconsistency: the database updates but the message fails to send. The outbox pattern writes messages to a database table in the same transaction as the business data, then a separate process reliably publishes from the outbox.
| Requirement | Recommended Pattern |
|---|---|
| One consumer per message | Message Queue |
| Many consumers per message | Publish-Subscribe |
| Immediate response needed | Request-Reply or synchronous API |
| Handle failures gracefully | Guaranteed Delivery + Dead Letter Queue |
| Complex routing logic | Message Router or ESB |
| Different data formats | Message Translator |
| Loose coupling between systems | Event-Driven with Pub-Sub |
RabbitMQ: Flexible, supports multiple messaging patterns, good for traditional enterprise integration.
Apache Kafka: Designed for high-throughput event streaming, excellent for event-driven architectures at scale.
AWS SQS/SNS: Managed cloud services: SQS for queues, SNS for pub-sub. Simple, scalable, no infrastructure to manage.
Azure Service Bus: Microsoft's enterprise messaging with advanced features like sessions and transactions.
MuleSoft: Full integration platform with visual design, API management, and extensive connectors.
Dell Boomi: Cloud-native iPaaS with low-code integration building.
Azure Logic Apps / AWS Step Functions: Cloud workflow orchestration for building integration flows.
Enterprise integration patterns provide proven solutions to common integration challenges. Rather than inventing solutions from scratch, understanding these patterns lets you choose appropriate approaches and communicate clearly with your team.
The key is matching patterns to requirements. Simple integrations do not need complex patterns. Complex requirements need strong patterns, but also more expertise to implement correctly. Start simple, and introduce patterns as complexity demands. When the requirements are complex, our custom system integration services choose and build the patterns with you.
Point-to-point integration connects each system directly to each other system, which works for a few systems with stable interfaces but becomes a tangled web as more are added. Hub-and-spoke integration routes every connection through a central hub, commonly an enterprise service bus (ESB), which routes and transforms messages. A hub suits many systems and centralised management, but can become a bottleneck and a single point of failure.
A message queue suits work where each message must be handled by one consumer, such as order processing where each order is handled exactly once. Publish-subscribe suits messages that many systems need, such as a customer profile update that must reach marketing, support and analytics tools at the same time. A queue also holds messages until the consumer is ready, even if it is temporarily unavailable.
A dead letter queue is a separate queue for messages that cannot be processed, for example because of an invalid format, no handler or repeated failures. The failed messages wait there for manual inspection instead of blocking normal processing or being silently discarded. Together with idempotent operations, a dead letter queue is a reliability essential rather than a nice-to-have.
An idempotent receiver can handle the same message more than once without side effects, so a message delivered twice because of a network issue gives the same result as processing it once. Idempotency comes from tracking unique message identifiers, designing operations as set state to X rather than increment by Y, including all needed data in the message, and using database transactions with upsert operations.
The right message broker depends on throughput, ordering and durability needs. RabbitMQ is flexible, supports several messaging patterns and suits traditional enterprise integration. Apache Kafka is designed for high-throughput event streaming at scale. Amazon Web Services (AWS) offers SQS for queues and SNS for publish-subscribe as managed services with no infrastructure to manage, and Azure Service Bus adds sessions and transactions.
Ask the author
Ask it here and it comes straight to the founder. No sales call, no obligation, and a real answer even if the answer is that you do not need us.
Kasun Wijayamanna
Founder, replies within one business day
Tell us what you are working on. We will come back with a practical recommendation and clear next steps.
Built here. Your data stays here.
Thanks for reaching out. We will get back to you within one business day.
See what else we do