Message Patterns and Architecture
Message Patterns and Architecture
Enterprise Integration Patterns (EIP) define solutions for common messaging challenges. This chapter covers the most important patterns tested in TT1.
Core Messaging Patterns
1. Point-to-Point (P2P)
In point-to-point messaging, a message is sent to exactly one consumer.
2. Publish/Subscribe (Pub/Sub)
A message is broadcast to all interested subscribers.
3. Request/Reply
A sender expects a response from the receiver.
4. Dead Letter Queue (DLQ)
Messages that cannot be processed are routed to a DLQ for inspection.
Enterprise Integration Patterns (EIP)
Message Router
Routes messages to different channels based on content or rules.
Message Transformer
Transforms a message from one format to another.
Message Filter
Removes unwanted messages from the stream.
Aggregator
Combines multiple related messages into a single message.
Splitter
Breaks one message into multiple smaller messages.
Saga Pattern
Manages distributed transactions across multiple services using a sequence of local transactions, each publishing events to trigger the next.
Architecture Considerations
Message Broker vs. Peer-to-Peer
Event-Driven Architecture (EDA)
Components react to events asynchronously. Benefits:
Summary
Mastering these patterns is essential for the TT1 exam. Understand when to apply each pattern and the trade-offs involved.