Adding a stream

You can add streams manually to allow for data isolation between applications, or to allow inter-operation with IBM® MQ publish/subscribe hierarchies.

Before you begin

Familiarize yourself with the way publish/subscribe streams operate. See Streams and topics.

About this task

Use PCF command, runmqsc, or IBM MQ Explorer to do these steps.
Note: You can perform steps 1 and 2 in any order. Only perform step 3 after steps 1 and 2 have both been completed.

Procedure

  1. Define a local queue with the same name as the stream on the earlier version of IBM MQ.
  2. Define a local topic with the same name as the stream on ht earlier version of IBM MQ.
  3. Add the name of the queue to the namelist, SYSTEM.QPUBSUB.QUEUE.NAMELIST
  4. Repeat for all queue managers at the later version of IBM MQ that are in the publish/subscribe hierarchy.

Adding 'Sport'

In the example of sharing the stream 'Sport', the earlier version queue managers and the later version IBM MQ queue managers are working in the same publish/subscribe hierarchy. The earlier version queue managers share a stream called 'Sport'. The example shows how to create a queue and a topic on later version queue managers called 'Sport', with a topic string 'Sport' that is shared with the earlier version queue managers stream 'Sport'.

A later version queue manager publish application, publishing to topic 'Sport', with topic string 'Soccer/Results', creates the resultant topic string 'Sport/Soccer/Results'. On the later version queue managers, subscribers to topic 'Sport', with topic string 'Soccer/Results' receive the publication.

On earlier version queue managers, subscribers to stream 'Sport', with topic string 'Soccer/Results' receive the publication.


runmqsc QM1
5724-H72 (C) Copyright IBM Corp. 1994, 2025.  ALL RIGHTS RESERVED.
Starting MQSC for queue manager QM1.
define qlocal('Sport')
     1 : define qlocal('Sport')
AMQ8006: IBM MQ queue created.
define topic('Sport') topicstr('Sport')
     2 : define topic('Sport') topicstr('Sport')
AMQ8690: IBM MQ topic created.
alter namelist(SYSTEM.QPUBSUB.QUEUE.NAMELIST) NAMES('Sport', 'SYSTEM.BROKER.DEFAULT.STREAM', 'SYSTEM.BROKER.ADMIN.STREAM')
     3 : alter namelist(SYSTEM.QPUBSUB.QUEUE.NAMELIST) NAMES('Sport', 'SYSTEM.BROKER.DEFAULT.STREAM', 'SYSTEM.BROKER.ADMIN.STREAM')
AMQ8551: IBM MQ namelist changed.
Note: You need both to provide the existing names in the namelist object, as well as the new names that you are adding, to the alter namelist command.

What to do next

Information about the stream is passed to other brokers in the hierarchy.

You must configure each IBM MQ queue manager in the hierarchy manually.