Question

I have 2 queues say Q1 and Q2. When I insert messages using MQPUT into Q1, is there any way that this message be replicated into Q2? Does WMQ have support for queue copy? Note : The queues reside on different queue managers.

Thanks, Hudson

Was it helpful?

Solution

If you have multiple consumers(Queues), which needs the same message, then Publish-Subscribe is made exactly for this purpose.

You can refer here for details about pub-sub.

If you are using Websphere MQ 7.XX, then you can use an Alias queue to publish the message.

You can follow below steps:

  1. Create a new Topic(Lets say "MyTopic" is your topic).
  2. Create an Alias queue(Lets call it as "MyPublisher"), with Base Type as Topic and give Base Object as "MyTopic"(Name of your topic).

  3. Now say Q1, Q2, Q3 have to get the message. Create subscriptions for these queues for Topic "MyTopic".

Now, the messages posted in queue "MyPublisher", will reach to all queues subscribing to the topic "MyTopic"(Q1,Q2,Q3).

Even remote queues can be given in destination while creating subscriptions. So, different queue managers will not be a problem as far as you have connectivity between them.

OTHER TIPS

If you don't want to bother with all of the Pub/Sub stuff, then have a look at the free open source project Message Multiplexer (MMX) at http://www.capitalware.biz/mmx_overview.html

Its purpose is to read messages from a source queue and put the exact same message to 'n' target queues (up to 99).

The download contains builds for AIX, HP-UX, Linux, IBM i (OS/400), Solaris, Windows and z/OS (mainframe).

MMX is a very simple and straight-forward program to use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top