Posted: Thu Dec 04, 2003 4:45 am Post subject: pub-sub example in WMQI
Novice
Joined: 22 Jan 2003 Posts: 19 Location: Bangalore
I'm trying to learn the pub-sub in WMQI, but have not been able to do so, so far. Please help me in providing the example flows for both publish and subscribe and also the test messages for that. Appreciate if u can suggest some good reference documents to do that.
Thanks,
Gopal
The Programming Guide has an in-depth description of pub-sub with WQMI.
There is nothing special you need to do when building a flow that acts as a subscriber. The MQInput node will be set up to read from the queue that has been subscribed to a particular topic.
If you want to build a flow that creates a subscription, you need to put in a compute node that says something like
Code:
set OutputRoot.MQMD.Format = 'MQHRF2 ';
Set OutputRoot.MQRFH2.psc.Command='RegSub';
Set OutputRoot.MQRFH2.psc.Topic='topic';
Set OuptutRoot.MQRFH2.psc.QName='SubscriberQueue';
Set OutputRoot.MQRFH2.psc.QMgrName='SubscriberQueueManager';
. And then wire this to an Output node that will put this message on the SYSTEM.BROKER.CONTROL.QUEUE (you might be able to use a publication node here instead).
If you want to build a flow that publishes a message, you will create your message, and then add a compute node with the following ESQL
Code:
set OutputRoot.MQMD.Format = 'MQHRF2 ';
Set OutputRoot.MQRFH2.psc.Command='Publish';
Set OutputRoot.MQRFH2.psc.Topic='topic';
And then you will wire the output of this comptue node to a Publication node. _________________ I am *not* the model of the modern major general.
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