Author |
Message
|
mqjava |
Posted: Fri Jun 03, 2011 9:39 am Post subject: Pub Sub |
|
|
 Voyager
Joined: 25 May 2009 Posts: 80 Location: New Jersey
|
Hi All,
Currently one of our app is opening a ALIAS queue ALIASQ.A in QMGRA and puts message which will go to the LOCAL queue LOCALQ.A in QMGRA.
We got a requirement - whatever the message put to ALIASQ.A on QMGR.A should go to two destinations: LOCALQ.A on QMGR.A and LOCALQ.A on QMGR.B.
Can we do this through Pub Sub? What changes needed from MQ infrastructure and any APP code changes needed?
Thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 03, 2011 9:54 am Post subject: Re: Pub Sub |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjava wrote: |
Can we do this through Pub Sub? |
Yes
mqjava wrote: |
What changes needed from MQ infrastructure |
Depends on your version of WMQ. Check the relevant InfoCenter for details.
mqjava wrote: |
and any APP code changes needed? |
Well the output message will need to be published now, and the 2 consuming apps will need subscriptions. Depending on your exact requirements this may or may not need changes. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjava |
Posted: Mon Jun 06, 2011 8:09 am Post subject: |
|
|
 Voyager
Joined: 25 May 2009 Posts: 80 Location: New Jersey
|
Thanks for the reply Vitor.
We use MQ 7.0.1.3.
Quote: |
Well the output message will need to be published now, and the 2 consuming apps will need subscriptions. Depending on your exact requirements this may or may not need changes. |
I wanted to ask if there will any change for the message sender app code? Currently message sender opens ALIAS queue ALIASQ.A in QMGRA and puts message, can the message sender app continue open the ALIASQ.A and send message without making any changes to their code?
Exact requirement is - application some times needs the message to be sent to one queue and sometimes it needs the message to be sent to multiple queues.
Thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jun 06, 2011 8:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjava wrote: |
I wanted to ask if there will any change for the message sender app code? Currently message sender opens ALIAS queue ALIASQ.A in QMGRA and puts message, can the message sender app continue open the ALIASQ.A and send message without making any changes to their code? |
AFAIK that's not how WMQv7 handles topics. I'll stand correction on that (not had much oppertunity to sandbox the new pub/sub). Also:
mqjava wrote: |
Exact requirement is - application some times needs the message to be sent to one queue and sometimes it needs the message to be sent to multiple queues. |
I don't see how you're going to manage that without some application changes. Somehow (no matter what method you use, pub/sub or not) the application is going to need to signal that the message has multiple destinations or that it doesn't.
What pub/sub would give you (once you've changed all the applications and designed the topic structure) is it would free the sending (publishing) application from needing to know how many copies of the message it needed and where they needed to go. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
exerk |
Posted: Mon Jun 06, 2011 9:05 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
To add to Vitor's comments:
1. Yes, you can define, or in your case redefine, WMQ objects to handle pub/sub without any changes to application code - effectively the queue manager will handle the duplexing/multiplexing of messages - and it will be transparent to the application.
CAVEAT: If replies are required the application will have to deal with multiple replies, possibly with varying data.
2. If you want some messages to go multiple queues on a per-message basis you will have to change the application code - with pub/sub it's all or nothing. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
mqjava |
Posted: Mon Jun 06, 2011 10:35 am Post subject: |
|
|
 Voyager
Joined: 25 May 2009 Posts: 80 Location: New Jersey
|
|
Back to top |
|
 |
zpat |
Posted: Mon Jun 06, 2011 11:43 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
There is a thread with examples of defining topic aliases and durable subscriptions to do this. |
|
Back to top |
|
 |
exerk |
Posted: Mon Jun 06, 2011 11:45 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
zpat wrote: |
There is a thread with examples of defining topic aliases and durable subscriptions to do this. |
For once-only and multiples? Natively, i.e. non-programmatically? _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jun 06, 2011 11:51 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
exerk wrote: |
zpat wrote: |
There is a thread with examples of defining topic aliases and durable subscriptions to do this. |
For once-only and multiples? Natively, i.e. non-programmatically? |
Natively, pub-sub handles once-only if there is only one subscriber to the matched topic.
So one could create topic aliases that match to topics that have known #s of subscribers. |
|
Back to top |
|
 |
exerk |
Posted: Mon Jun 06, 2011 12:00 pm Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
mqjeff wrote: |
exerk wrote: |
zpat wrote: |
There is a thread with examples of defining topic aliases and durable subscriptions to do this. |
For once-only and multiples? Natively, i.e. non-programmatically? |
Natively, pub-sub handles once-only if there is only one subscriber to the matched topic.
So one could create topic aliases that match to topics that have known #s of subscribers. |
Agreed, but my point was; can it be done such that the application requires no changes, e.g. addressing more than one queue or topic? The thrust of the OPs enquiry seems to be aimed at taking a 'dumb' application and having it put a message to a single target, or a message to multiple targets:
mqjava wrote: |
...I wanted to ask if there will any change for the message sender app code? Currently message sender opens ALIAS queue ALIASQ.A in QMGRA and puts message, can the message sender app continue open the ALIASQ.A and send message without making any changes to their code?
Exact requirement is - application some times needs the message to be sent to one queue and sometimes it needs the message to be sent to multiple queues... |
_________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jun 06, 2011 12:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
So one could create topic aliases that match to topics that have known #s of subscribers. |
One could, but doesn't this run the risk of pushing the information down into the infrastructure layer? Rather than having the topics more openly exposed to publishing and subscribing applications?
My only concern there is that it could all become "out of sight, out of mind" in terms of maintenance. Depends on how well regulated the site is of course. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|