|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
multiple subscribers |
« View previous topic :: View next topic » |
Author |
Message
|
mqs_guy |
Posted: Thu Dec 04, 2003 12:45 pm Post subject: multiple subscribers |
|
|
Acolyte
Joined: 09 May 2002 Posts: 71
|
Hi,
I have a publish message flow with the following ESQL in the compute node.
Set OutputRoot.MQRFH2.psc.Command='Publish';
Set OutputRoot.MQRFH2.psc.Topic='sports';
Hi,
I have a subscribe message flow with the following ESQL in the compute node.
Set OutputRoot.MQRFH2.psc.Command='RegSub';
Set OutputRoot.MQRFH2.psc.Topic='sports';
Set OutputRoot.MQRFH2.psc.QName='SubscriberQueue';
Set OutputRoot.MQRFH2.psc.QMgrName='SubscriberQueueManager'
Now, whenever a message with topic sports is published..the SubscriberQueue receives the publication.
What if i need another subscriber that subscribes to topic sports??
Do i create another message flow?? If i have n subscribers, would i have n message flows? If not, how do i specify the psc.QName?(queue where i would like my publication to fall) Is there a utility/command to send a message to the BROKER.SYSTEM.CONTROL.QUEUE, with MQRFH2.psc.* properties set??
Your views are appreciated.
Thanks in advance.
Cheers,
Vishal Agrawal |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 04, 2003 1:12 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The broker will send a copy of a published message to every subscriber that has subscription criteria that match the message.
The ESQL you have that says "Set OutputRoot.MQRFH2.psc.Command='RegSub'; " creates a message that is a RegisterSubscriber command. This creates a subscription for some particular queue. It does not cause a particular message flow to act as as subscriber. A message flow acts as a subscriber when it's input queue is registered as a subscriber.
So, if you sent three RegisterSubscription message to the broker, like the one you are building with ESQL in your example above, one for Queue A, one for Queue B, and the third for Queue C. Then, when a message was published for topic 'sports', the broker would put a copy of that message on all three queues.
[quote="mqs_guy"]Is there a utility/command to send a message to the BROKER.SYSTEM.CONTROL.QUEUE, with MQRFH2.psc.* properties set?? [/queue] Anything that can create a message with an MQRFH2 header and can set the .psc folder contents apporpriately, and can put a message on the SYSTEM.BROKER.CONTROL.QUEUE. So, you could write a java program, you could (as you did) write ESQL, you should be able to use the MQRFH utility, anything.
One possibility is that you could change the ESQL you have to specify the ReplyToQueue for the subscriber queue name. Then you have a message flow that will create a subscription for anyone who puts a request message on the input for the flow. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mqs_guy |
Posted: Thu Dec 04, 2003 1:48 pm Post subject: |
|
|
Acolyte
Joined: 09 May 2002 Posts: 71
|
Thanks Jeff for your quick reply.
Wanted to find out, which one of it, is the most recommended practice..
1)Having message flows that equal the number of subscribers?? (registersubscribe, as many times as, number of subscribers)
2) Or writing a java program that sets the MQRFH2.psc.* properties and run it as many times, as the number of subscribers (each time changing the MQRFH2.psc.QName so the publication falls to the queue set in MQRFH2.psc.QName)
Also, if u can point out a sample java program that would help me set the values.
Thanks & Regards,
Vishal Agrawal |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 04, 2003 2:09 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't really know what's typical.
What IBM seems to expect is that for "non-durable" subscriptions, the subscribing application will create a register subscription message when ti starts up and then deregister the subscription when the application quits., and that durable subscriptions will be created separately, on a case by case basis, using some sort of utiltiy.
As for a sample Java program, I don't know of any off hand either. There has been sample code in the Java/JMS forum here for creating MQRFH2 headers, so you might look there. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|