Capitalware has an MQ solution called MQ Message Replication (MQMR).
MQ Message Replication will clone messages being written (via MQPUT or MQPUT1 API calls) to an application’s output queue and MQMR will write the exact same messages to ‘n’ target queues (‘n’ can be up to 100). When MQMR replicates a message both the message data and the message’s MQMD structure will be cloned. This means that the fields of the MQMD structure (i.e. PutTime, MessageId, CorrelId, UserId, etc..) will be exactly the same as the original message’s MQMD structure.
The other day, Simone Jain posted a tutorial called Streaming messages to topics using alias queues to IBM Developer Tutorials.
The same solution can be applied to MQMR’s “Target Queues”. The first 2 steps are the same, so I’ll copy it using the example and text from the posting. In their example, they used the MQ Console to create the MQ objects, below, I will use MQSC commands for runmqsc program.
Step 1. Creating a topic for MQMR cloned messages to go to
Provide a topic name (i.e. DEV.APP_XYZ.CLONE) and topic string (i.e. dev/app_xyz/clone/).
DEFINE TOPIC(DEV.APP_XYZ.CLONE) TOPICSTR('dev/app_xyz/clone/')
Step 2. Creating an alias queue to redirect messages to our topic
You can name this queue whatever you’d like. We’ve used the DEV. prefix in this example i.e. DEV.APP_XYZ.CLONE.TO.TOPIC.QA.
Next, set the Base object field to the name of the topic created (i.e. DEV.APP_XYZ.CLONE) and the Base type field as ‘Topic’. Doing this means that the alias queue will resolve to this topic.
DEFINE QALIAS(DEV.APP_XYZ.CLONE.TO.TOPIC.QA) TARGTYPE(TOPIC) TARGET(DEV.APP_XYZ.CLONE)
Step 3. Configuring MQMR to use alias queue as a MQMR target queue
Let’s say you want to clone messages for queue ‘DEV.XYZ.Q’ and have the cloned messages to go to the topic defined above. You would simply add the following section to your MQMR IniFile.
i.e.
[Q:DEV.XYZ.Q] AddSourceInfo = Y TargetQueues=DEV.APP_XYZ.CLONE.TO.TOPIC.QA
If you already had a section in your MQMR IniFile cloning messages to a local or remote queue and wanted to add the clone messages going to a topic then you would add the queue alias to the Target Queues keyword.
i.e.
[Q:DEV.XYZ.Q] AddSourceInfo = Y TargetQueues=DEV.XYZ.COPY01.Q;DEV.XYZ.COPY02.Q;DEV.APP_XYZ.CLONE.TO.TOPIC.QA
Regards,
Roger Lacroix
Capitalware Inc.