Publish/subscribe messaging across multiple buses

When multiple buses are connected using a service integration bus link, you can connect individual topic space destinations to create a publish/subscribe configuration. Messages published in a topic space in one bus are accessible to subscribers on a topic space in another bus.

You can connect topic space destinations in neighboring buses by configuring a topic space mapping when you define the service integration bus link routing properties. Each entry in the mapping allows a local topic space destination to be mapped to a topic space in the foreign bus. A foreign bus is a representation of another service integration bus, or a WebSphere(r)® MQ queue manager, with which an existing service integration bus can exchange messages. As a result of establishing the topic space mappings, any subscribers to topics on the topic space in the local bus can receive messages published on those topics in the topic space in the other foreign bus. Unlike point-to-point queue destinations, publish/subscribe applications create producers and subscriptions to topic spaces in their local bus rather than identifying topic spaces that exist in foreign buses. You must configure the applications so that they have topic space mappings to route messages appropriately.

In the example, Publish/subscribe messaging across Bus 1 and Bus 2, a subscriber in Bus 1 can receive messages published in Bus 2. A Topic space mapping in Bus 1 enables publications from publishers attached to Topic space 2 in Bus 2 to flow to subscriptions attached to Topic space 1 in Bus 1.
Figure 1. Publish/subscribe messaging across Bus 1 and Bus 2A Topic space mapping in Bus 1 enablespublishers attached to Topic space 2 in Bus 2 to flow to subscriptions attached to Topic space 1 in Bus 1.

If subscriptions exist in both buses and publishers may publish from either bus, a topic space mapping is required in both buses to enable publications to flow between all publishers and subscribers in the two buses.

When connecting topic spaces in more than two buses, there is no restriction on how multiple buses can be connected. However, there is a restriction on how their topic spaces are connected using topic space mappings. For guidance on how to create topic space mappings, refer to Configuring topic space mappings between service integration buses.

A network of buses can contain loops in its topology, as shown in Network of buses with topic spaces connected correctly. Interconnected topic spaces must follow a hierarchical tree formation. This tree can then be overlaid on the underlying bus topology using topic space mappings as shown in Network of buses with topic spaces connected correctly. It is not permitted for a set of interconnected topic spaces to form a loop across multiple buses as shown in Network of buses with topic spaces connected incorrectly.
Note: The names of the local and foreign topic space do not have to match, but the names of the topics must match in both local and foreign buses.
Figure 2. Network of buses with topic spaces connected correctlyCorrect example of connected topic space containing no loops
Figure 3. Network of buses with topic spaces connected incorrectlyIncorrect example of connected topic space containing a loop

The correct example in Network of buses with topic spaces connected correctly shows that messages published in Bus 2 are automatically flowed through Bus 1 to Bus 3, if Bus 3 has a suitable subscription for those messages. You create a mapping from the topic space in Bus 1 to the topic space in Bus 2, and another mapping from the topic space in Bus 3 to the topic space in Bus 1.

If you also created a mapping from the topic space in Bus 2 to the topic space in Bus 3, as shown in Network of buses with topic spaces connected incorrectly, a loop would be created and published messages might enter an indefinite loop and be transmitted continually around the three buses.

If an additional subscription for the messages exists in Bus 2 and a publisher is also connected to Bus 3, topic space mappings are required in the reverse direction to allow messages to flow to all subscriptions in the system, as shown in Network of buses with topic space mappings in both directions.

Figure 4. Network of buses with topic space mappings in both directionsThree buses are connected in a loop, as in Figure 2, but with additional topic space mappings in the reverse direction.



Related concepts
Interconnected buses
Concept topic Concept topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 31, 2013 2:56:59 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-nd-dist&topic=cjj0094_
File name: cjj0094_.html