Datatype Channel
Explanation
Section titled “Explanation”An application that uses messaging often sends different kinds of data. The receiver must know how to process each item it gets (see Messaging).
The Datatype Channel pattern solves this with one channel per data type. Every message on a given channel then has the same type. A channel is a path that carries messages from sender to receiver (see Message Channel). In the Message Channel pattern, the messaging system already uses different channels for different kinds of information. Each channel has a specific purpose. This pattern applies that idea to data types.
Two roles follow from this:
- The sender knows the type of its data. It must pick the channel that matches that type.
- The receiver knows which channel a message arrived on. From the channel, it knows the type.
Other ways to handle mixed data. A Selective Consumer works differently. It reads a shared channel and filters out messages that do not match its criteria. With a Datatype Channel, the separation happens earlier, because the sender splits the data across channels.
The catalog also lists these related patterns: Canonical Data Model, Format Indicator, Message Dispatcher, Command Message, Selective Consumer and Message Channel.
Example
Section titled “Example”An online shop sends orders and payment confirmations. The team creates one channel named “orders” and another named “payment-confirmations”. The checkout service sends each order to “orders”. The payment service sends each confirmation to “payment-confirmations”. The shipping service reads only “orders”. It treats every message there as an order.
Trade-offs
Section titled “Trade-offs”The sender takes on the job of choosing the right channel for each message. The receiver gets simpler, because the channel tells it the type. The verified facts here do not cover other costs or benefits.
Diagram source
flowchart LR S1[Sender] -->|order| C1[Orders channel] S1 -->|payment| C2[Payments channel] C1 --> R1[Order receiver] C2 --> R2[Payment receiver]Checks
Section titled “Checks”- Each data type that the system sends has its own channel, so all messages on one channel share one type.
- Senders have a documented rule for choosing the channel that matches the data type.
- Receivers take the data type from the channel they read, not from the message content.
Related
Section titled “Related”- Message Channel
- Selective Consumer
- Format Indicator
- Canonical Data Model
- Messaging
- Point-to-Point Channel
- Publish/Subscribe Channel
- Content-based Router
Sources
Section titled “Sources”- Datatype Channel - Enterprise Integration Patterns — enterpriseintegrationpatterns.com, accessed 2026-11-09
- Selective Consumer - Enterprise Integration Patterns — enterpriseintegrationpatterns.com, accessed 2026-11-09
- Message Channel - Enterprise Integration Patterns — enterpriseintegrationpatterns.com, accessed 2026-11-09