Author |
Message
|
HarishKDewangan |
Posted: Fri Sep 23, 2011 7:32 am Post subject: Pub/Sub with dynamic subscription topic |
|
|
Novice
Joined: 23 Sep 2011 Posts: 13
|
Is there any way to set the subscription topic name dynamically .
I tried the below code in Subscriber flow :
Set OutputRoot.MQRFH2.psc.SubPoint = 'Sub_Point1';
Also I tried setting publication node Subscription Point property in publisher flow.
But this is not working.
Please let me know how to do the same.
Harish, |
|
Back to top |
|
 |
Esa |
Posted: Fri Sep 30, 2011 12:11 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Instead of putting discussion threads off topic as usually I am happy to be able to put this thread back to topic.
Subscription point and topic are not the same thing. Subsription point is, as far is I know, an IBM proprietary extension that allows you to for example request publications in different physical message formats. I suppose it is not very widely used. Luckily so, because in my opinion it can easily lead to bad design.
You cannot set the topic in a publication node. You always configure it dynamically an a compute node or equivalent before the publication node (Or configure it in the MQInput node)
Same is true with the subcriber flow. If you want to set the topic, you set ...psc.Topic.
There is nothing shameful in reading the manuals. I have over 8 years of experience with Message Broker and I still refer to the Infocenter. Just to make it sure I get it right from the beginning. |
|
Back to top |
|
 |
HarishKDewangan |
Posted: Fri Sep 30, 2011 12:51 am Post subject: |
|
|
Novice
Joined: 23 Sep 2011 Posts: 13
|
Esa, Thanks for the input.
Actually there was some typo error . I was talking about the Subscription Point property under Basic tab of 'Publication Node'.
I have tried setting the above mentioned property of the publication node in publisher flow.
& also tried Set OutputRoot.MQRFH2.psc.SubPoint = 'Sub_Point1'; in subscriber flow.
I wanted to achieve the dynamic subscription point under the same Topic to get the different format functionality mentioned by you.
I referred info center which talks about the above 2 settings. but it is not working as expected.
Please do comment on this post.
Harish, |
|
Back to top |
|
 |
Esa |
Posted: Fri Sep 30, 2011 1:18 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
HarishKDewangan wrote: |
I referred info center which talks about the above 2 settings. but it is not working as expected.
|
Harish, no one can help you if you do not describe the problem properly. "Not working as expected" does not tell much. You need to tell at least
- what you expected
- what happened
and preferably more. Posting the whole ESQL code where you set up the subscription, for example.
Pub/sub is a bit tricky when it comes to problem determination. If you subscription does not match the publication, nothing happens and you cannot find any error messages. Because from the pub/sub engines point of view that was normal operation. If I were you, I would first remove the subscription point from the publication node and the subscription and test if it works without subscription points. If it does not, your subscription topic probably does not match with the published topic or there is some other mismatch. |
|
Back to top |
|
 |
HarishKDewangan |
Posted: Fri Sep 30, 2011 1:48 am Post subject: |
|
|
Novice
Joined: 23 Sep 2011 Posts: 13
|
Esa ,
Here is the code :
Without any specific subscription point (Default subcription point)
--------------------------------------------------------------------------
Subscriber code
================
CALL CopyEntireMessage();
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.Topic = 'SPORTS';
SET OutputRoot.MQRFH2.psc.QName = 'DATA';
SET OutputRoot.MQRFH2.psc.QMgrName = 'ECSQM';
Declare PTR REFERENCE to OutputRoot.MQRFH2;
Detach PTR;
attach PTR TO OutputRoot.MQMD AS NEXTSIBLING ;
Publisher Code
===============
CALL CopyEntireMessage();
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = 'SPORTS';
Declare PTR REFERENCE to OutputRoot.MQRFH2;
Detach PTR;
attach PTR TO OutputRoot.MQMD AS NEXTSIBLING ;
RETURN TRUE;
Working fine , it is subscribing properly to the topic. (NO ISSUES)
MQ Explorer view :
TOPIC NAME : SYSTEM.BROKER.DEFAULT.SUBPOINT
TOPIC String : SPORTS
With Subscription Point :
================
Subscriber code
-----------------
CALL CopyEntireMessage();
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.Topic = 'SPORTS';
SET OutputRoot.MQRFH2.psc.QName = 'DATA';
SET OutputRoot.MQRFH2.psc.QMgrName = 'ECSQM';
Set OutputRoot.MQRFH2.psc.SubPoint = 'Sub_Point1';
Declare PTR REFERENCE to OutputRoot.MQRFH2;
Detach PTR;
attach PTR TO OutputRoot.MQMD AS NEXTSIBLING ;
RETURN TRUE;
Publisher code : esql code is same as before but Subscription Point property under Basic tab of Publication Node is Sub_Point1.
In this scenario even subscription is not getting created. |
|
Back to top |
|
 |
Esa |
Posted: Fri Sep 30, 2011 1:55 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
What is your broker version? MQ version? |
|
Back to top |
|
 |
HarishKDewangan |
Posted: Fri Sep 30, 2011 2:21 am Post subject: |
|
|
Novice
Joined: 23 Sep 2011 Posts: 13
|
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Sep 30, 2011 3:32 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
HarishKDewangan wrote: |
Both are 7.0 |
Is that
7.0.0.0
OR
7.0.0.1
OR
7.0.0.2
OR
7.0.0.3
???? _________________ 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 |
|
 |
HarishKDewangan |
Posted: Fri Sep 30, 2011 4:04 am Post subject: |
|
|
Novice
Joined: 23 Sep 2011 Posts: 13
|
WebSphere Message Broker Toolkit - Message Broker
Version: 7.0.0.1
Build id: 7.0.0.1-20100630_0750
(c) Copyright IBM Corp. and others 2000, 2010. All rights reserved.
This product is Built on Eclipseâ„¢ (http://www.eclipse.org)
IBM WebSphere MQ Explorer
Version: 7.0
(c) Copyright IBM Corporation and other(s) 1994, 2009. All Rights Reserved.
Visit http://www.ibm.com/webspheremq
This product is Built on Eclipseâ„¢ ( http://www.eclipse.org ) |
|
Back to top |
|
 |
Esa |
Posted: Mon Oct 03, 2011 2:07 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
HarishKDewangan wrote: |
Working fine , it is subscribing properly to the topic. (NO ISSUES)
MQ Explorer view :
TOPIC NAME : SYSTEM.BROKER.DEFAULT.SUBPOINT
TOPIC String : SPORTS
|
It was these lines that were puzzling me. But now I have the explanation. Subscription points are an extension used by Message Broker 6.0 and earlier pub/sub engine (called the Event Broker). Message Broker 7.0 does not have an event broker any more, it is using native WebSphere MQ publish subscribe instead. WMQ does not have native subscription points, it is emulating them with topic names. So when you are migrating from MB 6 you must migrate the subsription points as well. If you later want create new subscription points, you must manually add topics with topic names matching the subscription points and add the subsrciption point names to SYSTEM.QPUBSUB.SUBPOINT.NAMELIST.
See http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.amqnar.doc%2Fps29054_.htm |
|
Back to top |
|
 |
zpat |
Posted: Mon Oct 03, 2011 2:13 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Forgive my ignorance, but what is the difference between a subscription point in queued pub-sub, and just a subscription which specifies the topic string that it wants to receive publications on (with or without using a topic object)?
However WMB does not currently offer an encapsulation of the MQSUB API call. |
|
Back to top |
|
 |
Esa |
Posted: Mon Oct 03, 2011 2:40 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
zpat wrote: |
Forgive my ignorance, but what is the difference between a subscription point in queued pub-sub, and just a subscription which specifies the topic string that it wants to receive publications on (with or without using a topic object)?
|
With suscription points you can subscribe to the same topic string with different options. The classic example is requesting the messages in different physical formats: XML, cobol etc.
But, as I have said earlier, in my opinion this feature can easily lead into bad design: burdening the publisher with individual subscribers problems, which is against the whole idea of publish/subscribe. Because it is the publishing flow that has to modify the messages for each subscription point. In the worst case you will have to modify the publishing flow if the physical format requested by one of the subscribers changes. There are better ways to implement this scenario - without subscription points. |
|
Back to top |
|
 |
|