Middleware Systems Research Group, University of Toronto, Canada

Content-based Routing

In Internet Protocol (IP) routing, messages are routed based on the destination address of the message. Content-based routing supports a more powerful mechanism of routing messages based the message content to those destinations that are known to be interested in the content. The publish/subscribe paradigm is a realization of content-based routing.

Publish/Subscribe Model

Publish/subscribe is a communication paradigm in which the interaction between the information producer (publisher) and consumer (subscriber) is mediated by a set of brokers. Publishers publish events (or publications) to the broker network, and subscribers subscribe to interesting events by submitting subscriptions to the broker network. It is the responsibility of the brokers to route each event to interested subscribers. In content-based publish/subscribe, subscribers can specify constraints on the content of the events, and the broker network is said to perform content-based routing of events.


The routing in the PADRES distributed content-based publish/subscribe system is illustrated in the above figure. First it is assumed that publishers and subscribers connect to one of a set of brokers. Then the typical interaction is as follows.

  1. Publishers specify a template of their event space by submitting an advertisement message that is flooded through the broker network and creates a spanning tree rooted at the publisher.
  2. Similarly, subscribers specify their interest by sending a subscription message that is forwarded along the reverse paths of intersecting advertisements, i.e., those with potentially interesting events.
  3. Now publications from publishers are forwarded along the reverse paths of matching subscriptions to interested subscribers.

Publish/Subscribe Benefits

  • It is event-based, so it is a natural fit for event-driven applications..
  • It decouples clients through a declarative publish/subscribe interface.
  • It performs content-based routing to support expressive queries.
  • Interactions and queries are declarative (say what you want, not where/who to get it from).
  • Content-based addresses allow for flexible deployment environments.
  • It is responsive since events are pushed to clients immediately.


Publish/subscribe is a powerful messaging model that can support a wide variety of applications. These include enterprise applications such as distributed event monitoring and distributed system management.