Author |
Message
|
oli |
Posted: Mon Mar 22, 2010 8:31 am Post subject: Subscribe from within message flow |
|
|
Acolyte
Joined: 14 Jul 2006 Posts: 68 Location: Germany
|
Hi all,
does anybody know how a subscribe/unsubscribe can be done from within a message flow using WebSphere Message Broker 7 (with WebSphere MQ 7)?
In WebSphere Message Broker 6.1 the subscription could be done by simply putting a special message into a SYSTEM.BROKER queue.
Thanks,
Oli |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Mar 22, 2010 12:22 pm Post subject: Re: Subscribe from within message flow |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
oli wrote: |
Hi all,
does anybody know how a subscribe/unsubscribe can be done from within a message flow using WebSphere Message Broker 7 (with WebSphere MQ 7)?
In WebSphere Message Broker 6.1 the subscription could be done by simply putting a special message into a SYSTEM.BROKER queue.
Thanks,
Oli |
What does the manual say?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
oli |
Posted: Mon Mar 22, 2010 10:31 pm Post subject: |
|
|
Acolyte
Joined: 14 Jul 2006 Posts: 68 Location: Germany
|
Unfortunately I didn't find any hint in the manuals/info center concerning this isssue |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Mar 22, 2010 11:57 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
The whole pub/sub functionality for V7 was one of the big changes.
The Broker Pub/Sub engine was moved into the WMQ one.
Take a look at the WMQ V7 docs on Pub/Sub. _________________ 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 |
|
 |
oli |
Posted: Tue Mar 23, 2010 1:16 am Post subject: |
|
|
Acolyte
Joined: 14 Jul 2006 Posts: 68 Location: Germany
|
For sure I have read the MQ documentation concerning Pub/Sub but I couldn't find out how to do a subscription from within a message flow. I understand how to do a subscription from an MQ application but at the moment I don't understand how to do it from within a message flow, i.e. how the MQSUB can be executed from within a message flow ...
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Mar 23, 2010 1:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
oli |
Posted: Tue Mar 23, 2010 2:14 am Post subject: |
|
|
Acolyte
Joined: 14 Jul 2006 Posts: 68 Location: Germany
|
Hi mqjeff,
first thanks for your help. But does this mean that we can only create administrative subscriptions (of type "ADMIN") from within a message flow? Or is there any way to create a subscription with type "API", too?
Thanks,
Oli |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Mar 23, 2010 2:28 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The only option you have in ESQL is to build a PCF message, to the best of my very limited knowledge on this subject.
Whether or not a PCF message will allow you to create an "API" subscription instead of an "ADMIN" subscription, I don't know. I'm in fact unclear on the difference between the two. |
|
Back to top |
|
 |
oli |
Posted: Tue Mar 23, 2010 2:46 am Post subject: |
|
|
Acolyte
Joined: 14 Jul 2006 Posts: 68 Location: Germany
|
Is there anybody else who has a deeper knowledge about that issue? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Mar 23, 2010 9:49 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I would try like in V6 to create a JMS subscription. The broker should certainly be able to create the content for that type of message.
What does RFHutil(c) say?
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Mandeep |
Posted: Wed Mar 24, 2010 5:48 am Post subject: |
|
|
Apprentice
Joined: 03 May 2004 Posts: 33
|
In our case, since we did not have permissions to connect RFHUTIL to higher environments, so we created an HTTP based flow to do this job.
HTTPInput --> Compute --> MQPUT to SYSTEM.BROKER.CONTROL.QUEUE ---> HTTPReply
Below is the Compute Node ESQL:
SET OutputRoot.MQMD.MsgType = 1;
SET OutputRoot.MQMD.ReplyToQ = 'REPLY.TO.Q';
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 = 1208;
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.RegOpt = 'NewPubsOnly';
SET OutputRoot.MQRFH2.psc.QMgrName = queuemanagerName;
SET OutputRoot.MQRFH2.psc.Topic=topicName;
SET OutputRoot.MQRFH2.psc.QName = queueName; |
|
Back to top |
|
 |
zpat |
Posted: Wed Aug 10, 2011 12:30 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I am surprised that there is no encapsulation of the MQSUB function inside the message broker in version 7.
Is there really no way to subscribe in WMB 7 other than setting up an administrative subscription to a permanent queue? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Aug 10, 2011 7:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
zpat wrote: |
I am surprised that there is no encapsulation of the MQSUB function inside the message broker in version 7.
Is there really no way to subscribe in WMB 7 other than setting up an administrative subscription to a permanent queue? |
Don't be surprised... It's there, has been there, was always there...
Use the RFH2 like you would for a normal JMS subscription...
Still works like a charm...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
zpat |
Posted: Wed Aug 10, 2011 8:49 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You are referring to the "old" queue based pub/sub engine? Assuming the queue manager is configured to handle the "old" pub/sub queues requests.
But it's still not quite like the WMQ v7 MQSUB call.
How would using a queued subscription method allow a message flow to automatically subscribe? What would start the flow in the first place? I suppose you would need one flow to register the subscription and another to process the messages?
But it is another technique that I can consider, thanks. No doubt IBM will include MQSUB functionality at some point. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Aug 10, 2011 9:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
zpat wrote: |
But it's still not quite like the WMQ v7 MQSUB call. |
No, and I've spent a fair amount of time looking for that as well.
zpat wrote: |
How would using a queued subscription method allow a message flow to automatically subscribe? What would start the flow in the first place? I suppose you would need one flow to register the subscription and another to process the messages? |
I've done that and it does work, but so cumbersome. I cheated slightly and redesigned so that I could use scripted subscriptions to permantent queues as you indicated.
zpat wrote: |
No doubt IBM will include MQSUB functionality at some point. |
We can hope. And raise requirements. It's the squeaky wheel..... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|