Author |
Message
|
vinumon |
Posted: Tue May 06, 2014 9:38 am Post subject: How to send same message to two different queuemanagers |
|
|
Acolyte
Joined: 06 May 2014 Posts: 59
|
I need to send same message to 2 different Qmgrs, residing on two different servers, without clustering. |
|
Back to top |
|
 |
Vitor |
Posted: Tue May 06, 2014 10:03 am Post subject: Re: How to send same message to two different queuemanagers |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
vinumon wrote: |
I need to send same message to 2 different Qmgrs, residing on two different servers, without clustering. |
So send it to one and then to the other.
Or publish it.
Or use a distrubtion list.
But don't use clustering, because that won't do what you want.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PaulClarke |
Posted: Tue May 06, 2014 1:28 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Is this in production, or test, or just because you want to try it out ?
One of the simplest ways is to use my SupportPac MA01.
Suppose you are on QMA and want to send a message to queues called Q1 and Q2 on QMB and QMC respectively.
Then you can issue messages from QMA using a command like....
q -m QMA -o QMB/Q1 -o QMC/Q2
Each line of text you now type will be sent to the two different queue managers.
You can extend the concept and get your messages from a queue so....
q -m QMA -I INPUTQ -o QMB/Q1 -o QMC/Q2
This will take messages from queue INPUTQ and then send a copy to each of the target queues.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
exerk |
Posted: Tue May 06, 2014 11:01 pm Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
To expand slightly on what Vitor suggested, look at Post 4 in THIS THREAD. _________________ 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 |
|
 |
smdavies99 |
Posted: Wed May 07, 2014 12:08 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
As there was some debate in the thread that exerk linked to it might be easier to give an example, something like this
firstly, define a topic
Code: |
* ============================================================================ *
DEFINE TOPIC ('DATA.PUBLISH') +
TOPICSTR('$SYS/Data/PUBLISH/DATA/#') +
DESCR('BID Data Message Publication Topic') +
REPLACE
|
Next the Alias Queue
Code: |
* ---------------------------------------------------------------------------- *
def qa(MY_DATA.PUB) +
descr('Alias for Data Publishing Messages') +
defpsist(YES) +
target(DATA.PUBLISH) +
targtype(TOPIC) +
replace
|
finally a subscription
Code: |
* ---------------------------------------------------------------------------- *
DEFINE SUB('BIDS') +
TOPICOBJ('DATA.PUBLISH') +
DEST('BIDS.DATA.IN') +
EXPIRY(UNLIMITED) +
PSPROP(MSGPROP) +
PUBPRTY(ASPUB) +
REPLACE
* ---------------------------------------------------------------------------- *
|
So when a message is written to the ALIAS QUEUE. it gets published. ALL subcribers then get a copy of the message. In this case a message is sent to 'DATA.BIDS.IN'
The key points to note is the TARGET and TARGTYPE properties of the Alias queue definition. This feature was introduced with WMQ 7.0.
We use this technique a lot to save bandwidth when sending data to remote QMGRS some of which are a continent away and the Networks people refuse to give use more than a piece of wet string for bandwidth. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed May 07, 2014 3:01 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
smdavies99 wrote: |
We use this technique a lot to save bandwidth when sending data to remote QMGRS some of which are a continent away and the Networks people refuse to give use more than a piece of wet string for bandwidth. |
Can you expand on this please? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed May 07, 2014 3:54 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
PeterPotkay wrote: |
smdavies99 wrote: |
We use this technique a lot to save bandwidth when sending data to remote QMGRS some of which are a continent away and the Networks people refuse to give use more than a piece of wet string for bandwidth. |
Can you expand on this please? |
Instead of sending multiple copies of the same message to different destinations on the remote QMGR we send one message that is Published to all the destinations at the remote QMGR.
If you are at the MQTC I'll gladly explain it to you over a beer. The current system I'm working on uses 32 QMGRS and 22 Brokers. One of the wet string links is 3000km away. This is not a first world country btw. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed May 07, 2014 4:41 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
smdavies99 wrote: |
[
Instead of sending multiple copies of the same message to different destinations on the remote QMGR we send one message that is Published to all the destinations at the remote QMGR.
|
So you put to a remote q on your local QM that sends to an Alias queue on the Penguin QM in Antartica, and that Alias queue flips it to a Topic, and you have multiple subscribers on that Penguin QM?
smdavies99 wrote: |
[
If you are at the MQTC I'll gladly explain it to you over a beer. |
Deal, but it will have to be 2 beers. One for me and one for you. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 07, 2014 4:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@smdavies
I noticed that you did not specify a subscription scope.
Would not a subscope(ALL) take care of this if a default connection exists between publication and subscription qmgr?
Or are you trying to be more selective here and only propagate publications of a specific qmgr down the wet shoe string....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed May 07, 2014 5:29 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
So you put to a remote q on your local QM that sends to an Alias queue on the Penguin QM in Antartica, and that Alias queue flips it to a Topic, and you have multiple subscribers on that Penguin QM?
[/quote]
Yes, that is it. There are multiple subscribers on the Penguin QM
[quote="fjb_saper"]
Yes, we are propagating specific publications down the bit of wet string.
The data flowing to/from the different Penguin Queue Managers (Rockhopper, King, JackAss, Emperor etc) are specific to those QMGRS. Everything is distributed from PolarBear Central QMGR. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
vinumon |
Posted: Wed May 07, 2014 7:17 am Post subject: |
|
|
Acolyte
Joined: 06 May 2014 Posts: 59
|
@smdavies99 ,
I created TOPIC, SUB and alias queue on Qmgr1 and on the other Qmgr2 I created SUB , TOPIC only. I put message to alias queue on Qmgr1 , but I see message only on the local queue of Qmgr1. On Qmgr2, i dont see any messages. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed May 07, 2014 7:46 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Do you...
1) have a SDr/RCVR channel between the two Queue Managers?
2) defined the subscription of QM1 to point to a Remote Queue on QM1 that points to the local Q on QM2?
All pretty basic WMQ stuff really. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
vinumon |
Posted: Wed May 07, 2014 8:54 am Post subject: |
|
|
Acolyte
Joined: 06 May 2014 Posts: 59
|
As suggested by you, If SUB of QM1 is pointing to remote queue on QM1 that inturn points to local queue on QM2, then messages will be only on local queue of QM2.
I need same messages to be present on both QMgrs |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed May 07, 2014 9:13 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
vinumon wrote: |
As suggested by you, If SUB of QM1 is pointing to remote queue on QM1 that inturn points to local queue on QM2, then messages will be only on local queue of QM2.
I need same messages to be present on both QMgrs |
Two subscriptions to the same topic perhaps? Pub/Sub is a 1:Many tool. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
exerk |
Posted: Wed May 07, 2014 11:41 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
vinumon wrote: |
As suggested by you, If SUB of QM1 is pointing to remote queue on QM1 that inturn points to local queue on QM2, then messages will be only on local queue of QM2.
I need same messages to be present on both QMgrs |
The mechanism is more than adequately covered by PeterPotkay in the link I posted, and perfectly amplifies smdavies99's observation of 1:Many. _________________ 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 |
|
 |
|