home / infca / MQ Pub/Sub (navigation links) The road to innovation isn't paved at all (Sun)

Pub | Sub | App | Broker Links | End

MQ Pub/Sub


Publish

Amunt! Top Amunt!
Concepts

Publisher applications communicate with the broker using command messages in the RF Header format (or the equivalent functions in the Application Messaging Interface). Publishers can register with the broker before they start publishing information, they can register implicitly with their first publication, or they can choose not to register. When they have finished publishing information, they can deregister with the broker. They can also delete retained publications.

URL


Register to Publish

The publisher can send a Register Publisher command message to the broker's control queue (SYSTEM.BROKER.CONTROL.QUEUE) to indicate that a publisher will be, or is capable of, publishing data on one or more specified topics.


Subscribe

Amunt! Top Amunt!
Subscribe

Subscriber applications need to register their interest in receiving publications with a broker. Send the Register Subscriber command message to the SYSTEM.BROKER.CONTROL.QUEUE to register as a subscriber.


Running the application

Amunt! Top Amunt!
Sample application

To run the application on a single queue manager, first start the queue manager and then enter the following command:

runmqsc QMgrName < amqsresa.tst

This creates the appropriate queues on the queue manager. Then start the broker :

dspmqbrk strmqbrk

The results service program is started by entering the following:

amqsres QMgrName

You can now start one or more match simulators by entering the following command:

amqsgam Team1 Team2 QMgrName


Managing the Broker

Amunt! Top Amunt!
Control commands

URL


Broker Network

Adding a broker to a network

Before you can add a broker to the network, channels in both directions must exist between the queue manager that hosts the new broker and the queue manager that hosts the parent. Brokers use explicit addressing when sending messages to queues that reside on another queue manager. When the queue is opened by the broker, both the queue and queue manager names are specified. To facilitate multi-broker operation, this queue manager name must resolve to the appropriate transmission queue. The simplest method of achieving this is for the transmission queue to have the same name as the remote queue manager name.

To add a broker to the network, start the broker with the strmqbrk command specifying the name of the parent broker if appropriate. When the broker has been started with a parent named you cannot change the name of its parent, even when the broker is restarted. You cannot change the parent of a broker as part of normal operational procedures without disrupting service.

Sequence of commands for adding and deleting brokers

This example shows the sequence of commands for adding and deleting brokers in a network. Queue manager A is to host the parent broker and queue manager B is to host the child broker. Channels are defined between the two queue managers. Broker A is the parent broker, so this must be created first. Broker B is then created as a child broker of broker A. The sequence of commands to achieve this is as follows:

START CHANNEL (B.to.A) START CHANNEL (A.to.B) strmqbrk -m A strmqbrk -m B -p A

When both brokers are deleted, broker B must be deleted first, and broker A must be available for this to happen. Only when broker B has been deleted can broker A be deleted. The sequence of commands to achieve this is as follows.

endmqbrk -m B STOP CHANNEL (A.to.B) START CHANNEL (A.to.B) dltmqbrk -m B endmqbrk -m A STOP CHANNEL (B.to.A) START CHANNEL (B.to.A) dltmqbrk -m A

Links

PubSub User's Guide

Writing a simple publish/subscribe application connecting through MQ


Ep ! Valid HTML 4.01!   Valid CSS! Escriu-me !
Updated : 28/05/2008.  
Uf !