Author |
Message
|
jorro004 |
Posted: Thu Nov 01, 2007 2:38 pm Post subject: Advise on Publication Node |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Hi,
I have a scenario, where the Output message should also be routed to the publication node,
Right now I'm just using MQOutput Node to send message to Output queue.
I also wanted to use a Publicaiton node where I can publish message to the subscribers registered.
Can anyone advise, whether is it good idea to use publication node?
if so how can that be configured, because the way I did it as follows
JMSInput -- > JMSMQTransform ---> Compute ----->Publication Node
----->MQOutput Node
When I test this, THe broker complains about the "Attribute value not found or invalid Topic. "
I just added topic name inside the Publication Node, But not sure whether to take care of other things which I left
Please advise, on how can I configure the Publication Node to the message flow
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 01, 2007 2:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to specify the topic either on the Properties or in the RFH folder.
Read up on pub/sub and the changes to RFH will become clear.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rajmq |
Posted: Fri Nov 02, 2007 5:00 am Post subject: |
|
|
 Partisan
Joined: 29 Sep 2002 Posts: 331 Location: USA
|
RFH2 formats should be
for subscription :
<psc><Command>Regsub</Command><Topic>MyTopic</Topic><QName>MyQName</QName></psc>
for publish :
<psc><Command>Publish</Command><Topic>MyTopic</Topic></psc> _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified System Administrator - WebSphere Business Integration Message Broker V6.0 |
|
Back to top |
|
 |
Suresh Gupta |
Posted: Fri Nov 02, 2007 5:10 am Post subject: |
|
|
Apprentice
Joined: 29 Jun 2005 Posts: 46 Location: India
|
code compute node to set appropriate RFH2 headers to publish the message to the specified queue using publication node
like
SET OutputRoot.MQMD.MsgType = 1;
SET OutputRoot.MQMD.ReplyToQ = 'Q'; // reply queue name
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.psc.Topic=topicName;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
before publishing you need to send a subscription message to the broker specifing the subscription queue
like
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.QMgrName = 'WBRK6_DEFAULT_QUEUE_MANAGER';
SET OutputRoot.MQRFH2.psc.QName = 'Q1'; // subscription queue _________________ regards,
Suresh |
|
Back to top |
|
 |
jorro004 |
Posted: Fri Nov 02, 2007 7:02 am Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Thanks for your valuable suggestions,
Once the Output message sent to Publication and MQOutput Node, Will the message still be on the Publish Node, if there are no subscribers? |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Nov 02, 2007 7:06 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
The broker will put the message onto the queues that the registered subscribers have specified.
If there are no subscribers, then the message isn't sent to anybody. If you want the message 'held' so that it can be delivered 'later', then look into retained publications. |
|
Back to top |
|
 |
jorro004 |
Posted: Fri Nov 02, 2007 1:30 pm Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Hi,
Thanks for your suggestions.
I was trying to code the same logic which was mentioned above for the publication Node which I have in my flow.
SET OutputRoot.MQMD.Format = 'MQSTR';
SET OutputRoot.MQMD.Encoding = 273;
SET OutputRoot.MQMD.CodedCharSetId = 819;
SET OutputRoot.MQMD.MsgType = 1;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
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 = 'PUB_ID';
But when I send message to MQInput Node it complains with the below error.
writing message to queue 'TEST.OUT' on queue manager 'WBRK6_DEFAULT_QUEUE_MANAGER'. State = '-1' 'MQW102' '2027' '' :
when I comment out the MQRFH2 header, it sends message to Output queue, but it throws error for publication node
"BIP7056E: Attribute value not found or invalid Topic ".
Right now I dont have any subscribers to the Publication Node.
My question is: anyways the message flow doesnt have a subcriber to the publication node, So the message should go to the
output queue , but it throws error.
Can someone advise whether I overlooked any? I was trying for 2 hrs with various options. but couldnt work out
My flow is MQInput --> Compute --->MQOuput Node and Publication Node
Thanks |
|
Back to top |
|
 |
wbi_telecom |
Posted: Fri Nov 02, 2007 2:08 pm Post subject: |
|
|
 Disciple
Joined: 15 Feb 2006 Posts: 188 Location: Harrisburg, PA
|
I am not sure why you want to put the publication message to a queue . If you want to publish a message then you need to add rfh2 header and specify the topic and send it to the publication node. I think you will save yourself a lot of time and efforts if you read the Publish Subscribe manual.
Cheers, |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Nov 02, 2007 2:09 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
jorro004 wrote: |
My question is: anyways the message flow doesnt have a subcriber to the publication node, So the message should go to the
output queue , but it throws error. |
Do you really need both the output and publish?
The point of publish and subscribe is to keep your publisher from not having to know who is subscribing. If you already know that there are no subscribers, then maybe you should be doing point-to-point (MQOutput).
If the only reason that you are doing this is because you are testing, then register a subscriber and use the Publication.
However, if I'm reading your error message correctly, the 2027 indicates that you are missing a reply_to_queue in your message. Are you sending off a request message?
Last edited by bower5932 on Fri Nov 02, 2007 2:12 pm; edited 1 time in total |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Nov 02, 2007 2:11 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
jorro004 wrote: |
SET OutputRoot.MQMD.MsgType = 1; |
I just answered my question by looking at cmqc.h. A MsgType of 1 is a MQMT_REQUEST message. |
|
Back to top |
|
 |
jorro004 |
Posted: Sun Nov 04, 2007 12:26 pm Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Hi wbi_telecom
I'm not publishing message to a queue, I have a flow where I send Output message to both queue and Publication Node for subscribing applicaitons.
That is where I'm coding Compute Node to add header of RFH2 where it could publish message for Publication Node, and that is where I'm getting errors.
I need suggestion on this please.
Hi Bower,
I'm testing a scenario where the Output is sent to both queue and publication node. and that is where the errors.
Could you please suggest me on how and where can I set the subscriber for the publication?
and also regarding the message type ...how this changes as per the applications?Please refer me to any manuals
Thanks to all for ur suggestions!! |
|
Back to top |
|
 |
bower5932 |
Posted: Sun Nov 04, 2007 2:06 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Quote: |
Could you please suggest me on how and where can I set the subscriber for the publication?
and also regarding the message type ...how this changes as per the applications?Please refer me to any manuals |
If you are attempting to publish messages, I would expect that you would already have some code written to do the subscribing. If you don't, then try looking at mqjmssub.java at:
http://www-304.ibm.com/jct09002c/isv/tech/sampmq.html
As far as the message type is concerned, check out the Application Programming Reference and Application Programming Guide. |
|
Back to top |
|
 |
AkankshA |
Posted: Sun Nov 04, 2007 8:05 pm Post subject: Re: Advise on Publication Node |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
jorro004 wrote: |
scenario => the Output message should also be routed to the publication node,
|
IMHO one can make the flow like
JMSInput -> JMSMQTransform -> Compute -> MQOutput Node -> Publication Node
in compute node you need to build psc folder of MQRFH2 header.. possibly the eSQL for the same should include
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = Topic;
along with the MQMD/MQRFH2 fields already present(which i am assuming as JMSMQTransform node builds the entire headers)
Do let us know if you face any problem
Good Luck  _________________ Cheers |
|
Back to top |
|
 |
jorro004 |
Posted: Tue Nov 20, 2007 4:19 pm Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Hey Guys,
I'm sorry, I couldnt post the result.
I'm still getting same error
Nov 20 18:12:25 mqintel WebSphere Broker v6003[18635]: (WBRK6_DEFAULT_BROKER.EXECGRP)[-1360839760]BIP7056E: Attribute value not found or invalid Topic. : WBRK6_DEFAULT_BROKER.4f8e291b-1601-0000-0080-8ab53966dbd2: /build/S600_P/src/DataFlowEngine/JavaNodeLibrary/ImbPubSubPublishMessageHandler.cpp: 363: ImbPubSubPublishMessageHandler::getAttributes: ComIbmPSServiceNode: MSGFLOW#FCMComposite_1_4.ComIbmPublication#FCMComposite_1_1
I'm contructing the MQRFH2 header as follows:
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 their values
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 = 'PUB_ID';
SET OutputRoot.MQRFH2.psc.QMgrName = 'WBRK6_DEFAULT_QUEUE_MANAGER';
SET OutputRoot.MQRFH2.psc.QName = 'TEST_OUT';
SET OutputRoot.MQRFH2.psc.RegOpt = 'PersAsPub';
Currently, I dont have any subscribers for this topic. Is it still be va lid.?
How do I need set this before Publish
-----------------------------------------------------------------------------
comment from Suresh Gupta
before publishing you need to send a subscription message to the broker specifing the subscription queue
like
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.QMgrName = 'WBRK6_DEFAULT_QUEUE_MANAGER';
SET OutputRoot.MQRFH2.psc.QName = 'Q1'; // subscription queue
--------------------------------------------------------------------------------
I'm probably missing that part, which is why the error
Suggestions please?
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 20, 2007 6:18 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It is valid to have no subscribers to a topic.
You can publish on that topic.
Nobody receives the message, though.
The most important thing, and the thing that you always need to remember about publish-subscribe is...
There is no connection between the publisher and the subscriber, at all, in any way, of any kind, through any means. The publisher produces messages. The subscriber consumes messages. They do not otherwise communicate.
It is never an error to publish a message because of anything a subscriber has or has not done.
It is only ever an error on the publisher.
It is never an error on the subscriber side, because of anything the publisher has done. Either a subscriber receives messages, or it doesn't. If it doesn't, then there are no messages available for the topic it has subscribed to. This may not be the topic you think it has subscribed to, and the register subscription may not succed. This is not the fault of the publisher. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|