Author |
Message
|
KVBuser |
Posted: Fri Dec 17, 2010 6:39 am Post subject: Pub/Sub: where is the subscription node ??? |
|
|
Newbie
Joined: 22 Oct 2010 Posts: 9
|
Hi there,
I'm quite new to MQ and Broker, so I already apoligize if I’m asking stupid questions
I’m currently investigating the Publish/Subscribe features of Broker and MQ.
As I understand, publications are done via the ‘Publication’ node. If I want to implement a subscribing flow, it seems that I have to define a subscription on MQ level and that I have to use the ‘MQInputNode’ in my subscribing flow.
This means that I, as a developer, have to know the MQ queue on which the messages for a particular subscription will arrive. I would assume that Broker also provides something like a ‘Subscription’ node where you can specify to which topicString it subscribes without having to care about any MQ queue.
Is it correct to say that there is no out-of-the-box support in Broker to subscribe on TopicString level or am I missing something?
Thanks in advance !
Best Regards,
Kurt. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Dec 17, 2010 6:44 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
to subscribe to a publication, you send a correctly formatted message to SYSTEM.BROKER.CONTROL.QUEUE
The details of the publication you want to subscribe to are contained in the RFH2 Header, 'psc' folder.
In broker terms, this is quite easliy done with a single compute node and an MQOutput Node in a subflow. _________________ 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 |
|
 |
mqjeff |
Posted: Fri Dec 17, 2010 6:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You could use a JMSInput node...  |
|
Back to top |
|
 |
KVBuser |
Posted: Fri Dec 17, 2010 6:55 am Post subject: |
|
|
Newbie
Joined: 22 Oct 2010 Posts: 9
|
Thanks, I indeed understand that I can define subscriptions in Broker (via a compute node) or directly on MQ.
But, with a 'Subscription' node I don't mean a node which makes a subscription, but a node that can be used as an Input node in a flow which will process all the messages that arrive via that subscription.
I'm looking for a possibility to develop a subscribing flow (=subcriber) which is subscribing to a specific TopicString instead of using an MQInput node were I need to specify a specific MQ queue.
I hope I make myself clear in this. If not, please let me know ! |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 17, 2010 6:58 am Post subject: Re: Pub/Sub: where is the subscription node ??? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
KVBuser wrote: |
This means that I, as a developer, have to know the MQ queue on which the messages for a particular subscription will arrive. |
Yes. If you were developing a C or Java application it's perfectly reasonable that you would define a temporary dynamic queue for it's subscriptions and quote that in the subscription, rather than a permanent queue.
KVBuser wrote: |
Is it correct to say that there is no out-of-the-box support in Broker to subscribe on TopicString level or am I missing something? |
What you're missing is that it's the decision of the subscriber where it's subscription is delivered, as well as what topic's it's subscribed to and when these are delivered. A publication is just a data message described and routed in a particular way. The consuming application still has to know where it is, and in a pub/sub installation of any size you wouldn't want some "blind queue" mechanism, where all the subscriptions went to a generic SYSTEM object and the subscribers pulled information by topic alone. It would be a performance & administration nightmare. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 17, 2010 7:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
KVBuser wrote: |
But, with a 'Subscription' node I don't mean a node which makes a subscription, but a node that can be used as an Input node in a flow which will process all the messages that arrive via that subscription. |
That's an MQInput node. All subscriptions are delivered to a queue.
KVBuser wrote: |
I'm looking for a possibility to develop a subscribing flow (=subcriber) which is subscribing to a specific TopicString instead of using an MQInput node were I need to specify a specific MQ queue. |
You could easily develop a flow which subscribed to all the publications & read them off a single queue (the "blind queue" method I describe above) and then use logic within the flow to distribute them by topic (which is is included with the message).
KVBuser wrote: |
I hope I make myself clear in this. |
I see exactly what you mean. What I'm trying to make clear is a) it doesn't work the way you want it to work & b) you wouldn't want it to work that way.
I trust I've made myself clear in this. If not, please highlight your uncertainties. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 17, 2010 7:22 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I think it's perfectly reasonable to want a node that will create a temporary subscription to a temporary queue.
Again, a JMSInput node, with a bindings connection to the broker qmgr and a subscription on the input properties, will do just that... |
|
Back to top |
|
 |
KVBuser |
Posted: Fri Dec 17, 2010 7:26 am Post subject: |
|
|
Newbie
Joined: 22 Oct 2010 Posts: 9
|
I understand that the "blind queue" method is not a good idea and I'm perfectly happy that multiple queues are use.
In fact, I'm looking for a simular solution as the JMSOutput and JMSInput node were you can publish/subscribe on topic level. By which I mean, that a Message Broker developer only needs to know which topics he wants to use.
I assume that it should be possible to have a 'Subscription' node as InputNode were you subscribe to all messages of a specific topic. Once you deploy a flow with such a subscription node, the broker could create a subscription on MQ level with a corresponding MQ queue (managed) and afterwards the Broker could make sure that all messages that arrive via that subscription, go to the flow in which the 'Subcription' node was present?
In that case, a developer only needs to take care of the Topics which he needs to publish and subscribe.
Know that in my case I'm only interested in durable subscriptions. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 17, 2010 7:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There is no such thing as yet.
You can build and package a subflow that does what you want it to.
You can raise a requirement.
You can keep complaining that it doesn't exist. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 17, 2010 7:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
KVBuser wrote: |
I assume that it should be possible to have a 'Subscription' node as InputNode were you subscribe to all messages of a specific topic. Once you deploy a flow with such a subscription node, the broker could create a subscription on MQ level with a corresponding MQ queue (managed) and afterwards the Broker could make sure that all messages that arrive via that subscription, go to the flow in which the 'Subcription' node was present? |
All things are possible. I'm describing how things are & how they work, not how they could work, as well as displaying my ignorance of the JMS model!
I see 2 possibilities which are not exclusive:
1) You could write a custom "Subscription" node which acts as you describe. Start here and folow the instructions
2) You can contact your IBM account rep & ask for the WMB product to be enhanced to include a Subcription node. It's not something I've felt to lack of in WMB, but that may be because I'm something of a control freak with durable subscriptions & I can see the value of what you're proposing.
As has been said many times in this forum, the more people ask for something in an IBM product, the more likely it is to happen. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 17, 2010 8:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
I assume that it should be possible to have a 'Subscription' node as InputNode were you subscribe to all messages of a specific topic. Once you deploy a flow with such a subscription node, the broker could create a subscription on MQ level with a corresponding MQ queue (managed) and afterwards the Broker could make sure that all messages that arrive via that subscription, go to the flow in which the 'Subcription' node was present? |
You can do something approaching to it. You'd need to build a "subscription flow". The input to that flow would be the topic and the destination (i.e. where to send the subscription). The rest would then be a normal flow to handle the subscription(s)... This would become more interesting as you add brokers to your environment and are looking for a pattern of "no single point of failure".
There have been a few posts pertaining to this type of topology in the past few months... Use the search key!
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 17, 2010 8:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You might examine the POP3Input node supportPac for an interesting design pattern to use to build a "Subscription" node... without needing to use a User Defined Node. |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Sun Mar 25, 2012 4:03 pm Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
smdavies99 wrote: |
to subscribe to a publication, you send a correctly formatted message to SYSTEM.BROKER.CONTROL.QUEUE
The details of the publication you want to subscribe to are contained in the RFH2 Header, 'psc' folder.
In broker terms, this is quite easliy done with a single compute node and an MQOutput Node in a subflow. |
Would you be having a working example of what you are proposing ?
If I could get this working, I plan to enhance it, by providing the qualified topic string too. The WMB application is expected to process messages based on subscription wild card. And, the processing will be different (basically, route to a different destination) based on the actual topic string.
In the meantime, I have been trying the JMS Nodes sample that comes with the ToolKit. I am doing all that has been provided in set-up and yet, I have these messages as soon as the BAR is deployed.
Code: |
Mar 25 19:37:31 HOST WebSphere Broker v8000[13614]: (HOST.BRKR08.default)[9]BIP4640E: WMB JMSClient. 'Broker 'HOST.BRKR08'; Execution Group 'default'; Message Flow 'mySample03.ClientMessageFlow'; Node 'ComIbmJMSClientInputNode::JMI01::ComIbmJMSClientInputNode' ' There is a configuration problem with the JNDI Administered objects where: Initial Context Factory = 'com.sun.jndi.fscontext.RefFSContextFactory'. Location of the bindings = 'file:/home/HOST/my-Sample-JNDI'. ConnectionFactory Name = 'PubSub01'. JMS destination = ''. The exception text is : '#'. : HOST.BRKR08.0ac0b85f-3401-0000-0080-abbd4146b08d: JMSClientErrors.java: 662: JMSClientHelper::lookUpJMSDestinations(): : |
_________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Mar 25, 2012 7:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Cogito-Ergo-Sum wrote: |
If I could get this working, I plan to enhance it, by providing the qualified topic string too. The WMB application is expected to process messages based on subscription wild card. And, the processing will be different (basically, route to a different destination) based on the actual topic string.
In the meantime, I have been trying the JMS Nodes sample that comes with the ToolKit. I am doing all that has been provided in set-up and yet, I have these messages as soon as the BAR is deployed.
Code: |
Mar 25 19:37:31 HOST WebSphere Broker v8000[13614]: (HOST.BRKR08.default)[9]BIP4640E: WMB JMSClient. 'Broker 'HOST.BRKR08'; Execution Group 'default'; Message Flow 'mySample03.ClientMessageFlow'; Node 'ComIbmJMSClientInputNode::JMI01::ComIbmJMSClientInputNode' ' There is a configuration problem with the JNDI Administered objects where: Initial Context Factory = 'com.sun.jndi.fscontext.RefFSContextFactory'. Location of the bindings = 'file:/home/HOST/my-Sample-JNDI'. ConnectionFactory Name = 'PubSub01'. JMS destination = ''. The exception text is : '#'. : HOST.BRKR08.0ac0b85f-3401-0000-0080-abbd4146b08d: JMSClientErrors.java: 662: JMSClientHelper::lookUpJMSDestinations(): : |
|
Looks like you have mixed up topic and destination. Your code is complaining about the JMSDestination...
How did you define your topic in JNDI ??  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Sun Mar 25, 2012 7:16 pm Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
fjb_saper wrote: |
Looks like you have mixed up topic and destination. Your code is complaining about the JMSDestination...
How did you define your topic in JNDI ?? |
I did the definitions using MQ Explorer.
I defined TopicConnectionFactory and then the Topic01 pointing to a topic string. _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
|