Author |
Message
|
jorro004 |
Posted: Thu Dec 13, 2007 1:25 pm Post subject: How to Subscribe to Publish Node? |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
How to Subscribe to Publish Node?
Hi Masters,
I'm working on a flow where the Message is Published by the Publish Node on a topic and also created a Subsciber
flow in the same .bar file.
The structure of the flow are as follows
Publish Flow
MQInput-> Compute -> Publish and MQOutput
Subscribing Flow
MQInput -> Compute -> MQOuput
But the problem is, I cant see the message on the Subscribing Queue which was given in the Compute node of Publish Flow
and also in the MQInput of Subscribing flow
Here is my code in Publish Compute Node
CREATE PROCEDURE PublishNodeMessage() BEGIN
SET OutputRoot.MQMD = InputRoot.MQMD;
CREATE FIELD OutputRoot.MQRFH2.psc.Command;
CREATE FIELD OutputRoot.MQRFH2.psc.Topic;
CREATE FIELD OutputRoot.MQRFH2.psc.QMgrName;
CREATE FIELD OutputRoot.MQRFH2.psc.QName;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.CodedCharSetId = 1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 819;
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = 'PublishTopic';
SET OutputRoot.MQRFH2.psc.QMgrName = 'QMANAGER';
SET OutputRoot.MQRFH2.psc.QName = 'QUEUE_OUT';
SET OutputRoot.MQRFH2.psc.RegOpt = 'PersAsPub';
Can any one please suggest what are the things to be taken care of for the subscribing flow ?
or else correct if I'm wrong
It would be helpful if someone can forward or refer me to examples for Pub/Sub using WBIMB 6(publicaiton Node and JMSInput or MQInput for Subscribing)
Thanks for your help |
|
Back to top |
|
 |
samar14 |
Posted: Thu Dec 13, 2007 11:15 pm Post subject: |
|
|
Novice
Joined: 30 Nov 2007 Posts: 17
|
you need to first register the subscriber using RegSub in subscriber flow.
The queue name in the MQoutput node should be set to
SYSTEM.BROKER.CONTROL.QUEUE
In the subscriber flow compute node, you can use following ESQL.
SET OutputRoot.MQMD.Format='MQHRF2';
SET OutputRoot.MQRFH2.psc.command='RegSub';
SET OutputRoot.MQRFH2.psc.Topic='Stocks';
SET OutputRoot.MQRFH2.psc.QName='TEST_SUB';
Make sure it is registered successfully by doing
mqsibrowse <broker name > -t bsubscriptions
It should have a entry with the Qname and the topic.
Then try publishing on the topic 'Stocks' and you should get the
message on TEST_SUB. |
|
Back to top |
|
 |
jorro004 |
Posted: Fri Dec 14, 2007 7:38 am Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Thanks for your advise,
what will be the MQInput Q name in the subscriber flow? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 14, 2007 7:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
jorro004 wrote: |
Thanks for your advise,
what will be the MQInput Q name in the subscriber flow? |
The one you want the subscriber flow to read from...
which is the same as the one you registered the subscription to! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jorro004 |
Posted: Fri Dec 14, 2007 11:19 am Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
I tried doing the above advised setup.
I dont see any message in the Subscription queue.
Not sure whether I miss any? and couldnt find any subcriber in the mqsibrowse.
Following is my error message
BIP7056E: Attribute value not found or invalid Topic. :
Looks like there is no Topic registered, As I coded that in my Publish Flow as follows
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.CodedCharSetId = 1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 819; -SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = 'TestTopic';
Can any one help me...?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 14, 2007 6:37 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Use support pack rfhutil/rfhutilc to subscribe. (Easier to handle) You can then model a flow to act like rfhutil.
If you make the message a request message and supply a replyto qmgr and queue you will get the result of the subscription with a reason code.
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
jorro004 |
Posted: Mon Dec 17, 2007 6:47 am Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Hi fjb_saper
I have a subscriber flow in place of rfhutil as below
MQInput(TEST_SUB) -> Compute -> MQOutput(SYSTEM.BROKER.CONTROL.QUEUE )
and code in compute node as below
SET OutputRoot.MQMD.Format=MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format='MQSTR';
SET OutputRoot.MQRFH2.CodedCharSetId = 1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 819;
SET OutputRoot.MQRFH2.psc.Command='RegSub';
SET OutputRoot.MQRFH2.psc.Topic='TestTopic';
SET OutputRoot.MQRFH2.psc.QMgrName = 'QMANAGER';
SET OutputRoot.MQRFH2.psc.QName='TEST_SUB';
As per the above, I believe the message should be on TEST_SUB queue. But I dont see any message on that queue.
As per your advise is this the additional step to be done to create a replyto qmgr in the subscriber flow?
Can you please advise?
Thanks |
|
Back to top |
|
 |
jorro004 |
Posted: Mon Dec 17, 2007 1:22 pm Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Can some one please forward samples for implementing Message Broker based Publish/Subscribe message flow using publication node
jorro004@yahoo.com
thanks
Last edited by jorro004 on Mon Dec 17, 2007 1:36 pm; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Dec 17, 2007 1:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Your setup is good. Now make that message a request message and add a reply to q and reply to qmgr (MQOutput node options). Whenever you send a subscription the engine will send a confirmation message to the replyto qmgr/q. In rfhutil you will get a pscr folder with either a 0 reason code (subscription successful) or a non 0 reason code -- (subscription failed for reason code given).
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jorro004 |
Posted: Mon Dec 17, 2007 3:20 pm Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
I dont see any Topics registered with broker in the subscriber list from toolkit and I get the below error message, when I try to Insert message
into the Input Q of the Publish Flow
BIP7056E: Attribute value not found or invalid Topic.
I believe though the flow design is correct, probably looking at the configuration settings which I missed ?
Can anyone please help or suggestions?
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 17, 2007 4:15 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jorro004 wrote: |
Can anyone please help or suggestions?
|
fjb_saper has twice suggested you use rfhutil to work out what's wrong with your subscription by receiveing the reason code. Why are you asking for more help and suggestions when you're not following the ones already given?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Dec 18, 2007 3:06 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
pls extract some time and go thru the pub sub manual..
meantime for some quick bites..
Quote: |
As per the above, I believe the message should be on TEST_SUB queue. But I dont see any message on that queue. |
MSg ll not stay in TEST_SUB queue as your flow is picking it
MQInput(TEST_SUB) -> Compute -> MQOutput(SYSTEM.BROKER.CONTROL.QUEUE )
Quote: |
I dont see any Topics registered with broker in the subscriber list |
You ll not be able to see the topic as you are creating runtime topics
send the subscription thru TEST_SUB queue
verify that the subscription has been registered successfully thru toolkit.
send a publication on the same topic thru publish flor
Publish Flow
MQInput-> Compute -> Publish _________________ Cheers |
|
Back to top |
|
 |
jorro004 |
Posted: Tue Dec 18, 2007 7:02 am Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Thanks for making it clear
I searched for the Pub/Sub manuals online but couldn't find them. Can anyone refer me to those |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Dec 18, 2007 10:03 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|