Multiple processing steps in a Pipes and Filters chain are connected by Message Channels.
How can you decouple individual processing steps so that messages can be passed to different filters depending on a set of conditions?
Insert a special filter, a Message Router, which consumes a Message from one Message Channel and republishes it to a different Message Channel channel depending on a set of conditions.
The Message Router differs from the most basic notion of Pipes and Filters in that it connects to multiple output channels. Thanks to the Pipes and Filters architecture the components surrounding the Message Router are completely unaware of the existence of a Message Router. A key property of the Message Router is that it does not modify the message contents. It only concerns itself with the destination of the message.
The key benefit of using a Message Router is that the decision criteria for the destination of a message are maintained in a single location. If new message types are defined, new processing components are added, or the routing rules change, we need to change only the Message Router logic and all other components remain unaffected. Also, since all messages pass through a single Message Router, incoming messages are guaranteed to be processed one-by-one in the correct order....
Related patterns: Channel Adapter, Content-Based Router, Control Bus, Datatype Channel, Dynamic Router, Message Filter, Message, Message Channel, Message History, Introduction to Message Routing, Message Translator, Pipes and Filters, Publish-Subscribe Channel, Transactional Client
Want to keep up-to-date? Follow My Blog.
Want to read more in depth? Check out My Articles.
Want to see me live? See where I am speaking next.
Find the full description of this pattern in:
From Enterprise Integration to Enterprise Transformation:
My new book describes how architects can play a critical role in IT transformation by applying their technical, communication, and organizational skills with 37 episodes from large-scale enterprise IT.
Parts of this page are made available under the Creative Commons Attribution license. You can reuse the pattern icon, the pattern name, the problem and solution statements (in bold), and the sketch under this license. Other portions of the text, such as text chapters or the full pattern text, are protected by copyright.
|© 2003, 2019 • Bobby Woolf • All rights reserved.|