Search code examples
javaapache-camelesb

Difference between Message Router and Content based Router in EIP


I'd like to understand what exactly is the difference between the two Enterprise Integration Patterns

Content-Based Router

Message Router

The definition at camel documentation is suggestive that Content-Based router is a special case of Message Router. They why list them separately?


Solution

  • Actually "Message Router" is one of the "Basic Messaging Concepts". List of such basic messaging concepts is:

    • Channel - Messaging applications transmit data through a Message Channel, a virtual pipe that connects a sender to a receiver.
    • Message - A Message is an atomic packet of data that can be transmitted on a channel.
    • Multi-step delivery - Set of actions often need to be performed on the message after it is sent by its original sender but before it is received by its final receiver.
    • Routing - In a large enterprise with numerous applications and channels to connect them, a message may have to go through several channels to reach its final destination. The route a message must follow may be so complex that the original sender does not know what channel will get the message to the final receiver. Instead, the original sender sends the message to a Message Router.
    • Transformation - Various applications may not agree on the format for the same conceptual data; the sender formats the message one way, yet the receiver expects it to be formatted another way.
    • Endpoint - An application does not have some built-in capability to interface with a messaging system. Rather, it must contain a layer of code that knows both how the application works and how the messaging system works, bridging the two so that they work together.

    "Content Based Router" is one of the "Message Routers" and there are a lot of different other Message Routers available like "Message Filter", "Splitter", "Aggregator", "Recipient list" etc.

    I suggest reading a book that used by camel so all such points will be more clear: https://www.amazon.com/o/asin/0321200683/ref=nosim/enterpriseint-20