--- url: "http://www.enterpriseintegrationpatterns.com/MessageRouter.html" titulek: "Message Router - Enterprise Integration Patterns" h1: "" popis: "How can you decouple individual processing steps so that messages can be passed to different filters depending on a set of conditions?" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-15 15:34:12" znaku: 7105 slov: 639 kodovani: "utf-8" sha256: "a4f1bda42d7ab7edf2340d2b661d36fc39b9bb0b52fb0bb3dae2b844ae10e3c6" --- Messaging Patterns [Messaging Patterns](index.html) - [Integration Styles](IntegrationStylesIntro.html) - [Messaging Systems](MessagingComponentsIntro.html) - [Messaging Channels](MessagingChannelsIntro.html) - [Message Construction](MessageConstructionIntro.html) - [Interlude: Simple Messaging](SimpleMessagingIntro.html) - [Message Routing](MessageRoutingIntro.html) - [Message Transformation](MessageTransformationIntro.html) - [Interlude: Composed Messaging](ComposedMessagingExample.html) - [Messaging Endpoints](MessagingEndpointsIntro.html) - [System Management](SystemManagementIntro.html) - Interlude: Systems Management Example - Integration Patterns in Practice - Concluding Remarks - Appendices | | Message Router[Messaging Patterns](index.html) » [Messaging Systems](MessagingComponentsIntro.html) | [Contents](toc.html)[⇐ Prev](PipesAndFilters.html)[Next ⇒](MessageTranslator.html) | | --- | --- | --- | Multiple processing steps in a [*Pipes and Filters*](PipesAndFilters.html) chain are connected by [*Message Channel*](MessageChannel.html)s. 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*](Message.html) from one [*Message Channel*](MessageChannel.html) and republishes it to a different [*Message Channel*](MessageChannel.html) channel depending on a set of conditions. The *Message Router* differs from the most basic notion of [*Pipes and Filters*](PipesAndFilters.html) in that it connects to multiple output channels. Thanks to the [*Pipes and Filters*](PipesAndFilters.html) 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. ... Read the entire pattern in the book [Enterprise Integration Patterns](/books1.html) **Related patterns:** [*Channel Adapter*](ChannelAdapter.html), [*Content-Based Router*](ContentBasedRouter.html), [*Control Bus*](ControlBus.html), [*Datatype Channel*](DatatypeChannel.html), [*Dynamic Router*](DynamicRouter.html), [*Message Filter*](Filter.html), [*Message*](Message.html), [*Message Channel*](MessageChannel.html), [*Message History*](MessageHistory.html), [*Introduction to Message Routing*](MessageRoutingIntro.html), [*Message Translator*](MessageTranslator.html), [*Pipes and Filters*](PipesAndFilters.html), [*Publish-Subscribe Channel*](PublishSubscribeChannel.html), [*Transactional Client*](TransactionalClient.html) --- ## Integration Pattern Language [Message Construct.](MessageConstructionIntro.html) [Message](Message.html) [Command Message](CommandMessage.html) [Document Message](DocumentMessage.html) [Event Message](EventMessage.html) [Request-Reply](RequestReply.html) [Return Address](ReturnAddress.html) [Correlation Identifier](CorrelationIdentifier.html) [Message Sequence](MessageSequence.html) [Message Expiration](MessageExpiration.html) [Format Indicator](FormatIndicator.html) [Message Routing](MessageRoutingIntro.html) [Pipes-and-Filters](PipesAndFilters.html) [Message Router](MessageRouter.html) [Content-based Router](ContentBasedRouter.html) [Message Filter](Filter.html) [Dynamic Router](DynamicRouter.html) [Recipient List](RecipientList.html) [Splitter](Sequencer.html) [Aggregator](Aggregator.html) [Resequencer](Resequencer.html) [Composed Msg. Processor](DistributionAggregate.html) [Scatter-Gather](BroadcastAggregate.html) [Routing Slip](RoutingTable.html) [Process Manager](ProcessManager.html) [Message Broker](MessageBroker.html) [Message Transformation](MessageTransformationIntro.html) [Message Translator](MessageTranslator.html) [Envelope Wrapper](EnvelopeWrapper.html) [Content Enricher](DataEnricher.html) [Content Filter](ContentFilter.html) [Claim Check](StoreInLibrary.html) [Normalizer](Normalizer.html) [Canonical Data Model](CanonicalDataModel.html) [Messaging Endpoints](MessagingEndpointsIntro.html) [Message Endpoint](MessageEndpoint.html) [Messaging Gateway](MessagingGateway.html) [Messaging Mapper](MessagingMapper.html) [Transactional Client](TransactionalClient.html) [Polling Consumer](PollingConsumer.html) [Event-driven Consumer](EventDrivenConsumer.html) [Competing Consumers](CompetingConsumers.html) [Message Dispatcher](MessageDispatcher.html) [Selective Consumer](MessageSelector.html) [Durable Subscriber](DurableSubscription.html) [Idempotent Receiver](IdempotentReceiver.html) [Service Activator](MessagingAdapter.html) [Messaging Channels](MessagingChannelsIntro.html) [Message Channel](MessageChannel.html) [Point-to-Point Channel](PointToPointChannel.html) [Publish-Subscr. Channel](PublishSubscribeChannel.html) [Datatype Channel](DatatypeChannel.html) [Invalid Message Channel](InvalidMessageChannel.html) [Dead Letter Channel](DeadLetterChannel.html) [Guaranteed Delivery](GuaranteedMessaging.html) [Channel Adapter](ChannelAdapter.html) [Messaging Bridge](MessagingBridge.html) [Message Bus](MessageBus.html) [Systems Mgmt.](SystemManagementIntro.html) [Control Bus](ControlBus.html) [Detour](Detour.html) [Wire Tap](WireTap.html) [Message History](MessageHistory.html) [Message Store](MessageStore.html) [Smart Proxy](SmartProxy.html) [Test Message](TestMessage.html) [Channel Purger](ChannelPurger.html) - » [Read the latest in My Blog](/ramblings) - » [Get more insights from My Articles](/articles.html) - » [See me live in my Upcoming Talks](/talks) You can reuse the following elements under the [Creative Commons Attribution](http://creativecommons.org/licenses/by/4.0/) license: pattern icon, pattern name, problem and solution statements (in bold), and the sketch. Other portions are protected by copyright. [Enterprise Integration Patterns](https://amazon.com/o/asin/0321200683/ref=nosim/enterpriseint-20) The de-facto language for designing asynchronous, distributed systems. Over 100,000 copies sold. [The Software Architect Elevator](https://www.architectelevator.com/book) Rethink the role of architects as a connecting element across organizational layers. Acquire the technical, communication, and organizational skills to succeed in this new role. [Cloud Strategy](https://www.cloudstrategybook.com) Make your cloud migration a success by translating high-level goals into conscious decisions with well-understood trade-offs. [Platform Strategy](https://www.platformstrategybook.info) Platforms can boost innovation through harmonization, but they aren't easy to build. Learn from over a decade of designing and rolling out IT platforms.