Publish/subscribe topologies

A publish/subscribe application can consist of a network of one or more brokers connected together. The brokers can all be on the same physical system, or they can be distributed over several physical systems. By connecting brokers together, publications can be received by a client on any broker in the network.

This provides the following benefits:

Publications are sent only to brokers that have subscribers that have expressed an interest in the topics being published. This helps to optimize network traffic.

Collectives

A collective is a set of brokers that are fully interconnected and form part of a multi-broker network for publish/subscribe applications.

A broker cannot belong to more than one collective. Brokers within the same collective can exist on physically separate computers. Each pair of broker queue managers must be connected together by a pair of WebSphere MQ channels.

The following figure shows a simple collective of three brokers:

A collective of three brokers

Broker networks

There are three ways of connecting brokers together to make a broker domain:
  • Brokers can be joined together in a hierarchical tree structure.
  • Brokers can be grouped together into collectives, where a collective is a set of one or more brokers that are directly connected to each other.
  • Collectives can be joined together in a tree structure; this is a combination of the previous two ways of grouping brokers together.

A broker can belong to only one collective.

Brokers within a collective can all be on one physical system, or they can be on separate physical systems.

A collective provides the following benefits:
  • Messages destined for a specific broker in the same collective are transported directly to that broker and do not need to pass through an intermediate broker. This improves broker performance and optimizes inter-broker publish/subscribe traffic, in comparison with a hierarchical tree configuration.
  • If your clients are geographically dispersed, you can set up a collective in each location, and connect the collectives (by joining a single broker in each collective) to optimize the flow of publications and subscription registrations through the network.
  • You can group clients according to the shared topics that they publish and to which they subscribe.

    Clients that share common topics can connect to brokers within a collective. The common publications are transported efficiently within the collective, because they do not pass through brokers that do not have at least one client with an interest in those common topics.

  • A client can connect to its nearest broker, to improve its own performance. The broker receives all messages that match the subscription registration of the client from all brokers within the collective.

    The performance of a client application is also improved for other services that are requested from this broker, or from this broker's queue manager. A client application can use both publish/subscribe and point-to-point messaging.

  • The number of clients per broker can be reduced by adding more brokers to the collective to share workload within that collective.

The following diagram shows a network of six collectives grouped in a hierarchical structure.


This diagram shows six collectives grouped in a hierarchical structure; there is two-broker collective connected to three collectives, with four, one, and three brokers, respectively; the four-broker collective has two further collectives connected to it with five and three brokers, respectively.

When you create a collective, the workbench ensures that the connections that you make to other collectives and brokers are valid. You are prevented from making connections that would cause messages to cycle forever within the network. You are also prevented from creating a collective of brokers that does not have the required WebSphere MQ connections already defined.

The queue manager of each broker in a collective must have a connection to every other queue manager in the collective.

Each broker in the collective maintains a list of its neighbors.

A neighbor can be one of the following:

The complete list of neighboring brokers forms a broker's neighborhood.

Related concepts
Broker

Related tasks
Developing publish/subscribe applications