Author |
Message
|
next |
Posted: Thu Apr 07, 2011 3:25 am Post subject: How to put the same message in two queues of same QM? |
|
|
Voyager
Joined: 02 May 2010 Posts: 75
|
Hi
Is there a way to put the same message in two queues of the same QM?
The message is coming from a third party using a remote queue and already a flow is consuming the message. The requirement is that another flow has to process the same message.
Please let me know if there are any ideas. |
|
Back to top |
|
 |
santnmq |
Posted: Thu Apr 07, 2011 3:35 am Post subject: |
|
|
Centurion
Joined: 11 Jan 2011 Posts: 125
|
you can write another intermediate flow to make two copies of the same message before it is processed.. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Apr 07, 2011 3:37 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
zpat |
Posted: Thu Apr 07, 2011 3:42 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Or use a topic alias and two administrative durable subscritions. |
|
Back to top |
|
 |
next |
Posted: Thu Apr 07, 2011 3:48 am Post subject: |
|
|
Voyager
Joined: 02 May 2010 Posts: 75
|
We dont want to change the existing flow. Can we handle this in MQ itself?
@zpat ..Could you please elaborate on the subscription solution? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 07, 2011 4:07 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
you would need to change the queue that the existing flow is reading.
Change it's name, then create the same named object but as a TOPIC instead of a QUEUE.
Then create two SUBS that each point to two new QUEUES. Then put the flows listening to this queue.
Or, again, put a different flow listening to the current queue, and have it duplicate the message to two new queues. |
|
Back to top |
|
 |
zpat |
Posted: Thu Apr 07, 2011 4:09 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Ensure the PSMODE enabled (only need do this once).
ALTER QMGR PSMODE(ENABLED)
Define topic object with fixed topic string (of your choice)
DEFINE TOPIC(TEST.DUP) TOPICSTR('/MQ/DUPLICATE/TEST.QUEUE1')) DURSUB(YES) REPLACE
Define topic alias queue using topic object
DEFINE QALIAS(TEST.ALIAS) DEFPSIST(YES) TARGTYPE(TOPIC) TARGET(TEST.DUP) REPLACE
Define local queues to receive the messages (they could also be remote queues as needed)
DEFINE QLOCAL(TEST.QUEUE1) DEFPSIST(YES) REPLACE
DEFINE QLOCAL(TEST.QUEUE2) DEFPSIST(YES) REPLACE
Define admin durable subscriptions
DELETE SUB(TEST.SUB1)
DEFINE SUB(TEST.SUB1) DEST(TEST.QUEUE1) TOPICOBJ(TEST.DUP) PSPROP(NONE)
DELETE SUB(TEST.SUB2)
DEFINE SUB(TEST.SUB2) DEST(TEST.QUEUE2) TOPICOBJ(TEST.DUP) PSPROP(NONE)
Now - just put a message to TEST.ALIAS and it should appear on both local queues. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Apr 07, 2011 5:23 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
These MQ suggestions assume the version is MQ 7. They are not possible in MQ 6. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
|