Author |
Message
|
shafi1990 |
Posted: Fri Sep 27, 2013 12:53 am Post subject: Subscription using ESQL |
|
|
Newbie
Joined: 27 Sep 2013 Posts: 7
|
Hi,
I am using IBM WMB v8.0 and MQ v7.0.1.3. Currently, A topic has been created and tried to subscribe topic using esql with following code
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.Topic = 'Weather';
SET OutputRoot.MQRFH2.psc.QMgrName = 'V8QM';
SET OutputRoot.MQRFH2.psc.Filter = 'Root.XMLNSC.Forecast.Temperature > 30';
SET OutputRoot.MQRFH2.psc.QName = 'OUT';
and then this message is sent to SYSTEM.BROKER.CONTROL.QUEUE but in subscription folder of MQExplorer, subscription is not registered.
I have no idea why subscription is not registered .. please me
* Note : content based filtering and publish/subscriber mode already set to enabled.
thanks in advance.
Regards,
Shafee |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Sep 27, 2013 1:18 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Have you setup the MQMD so that WMQ knows that there is an RFH2 Header?
Have you setup the RFH2 Header correctly?
There are plenty of examples of this in this forum is you search for them. _________________ 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 |
|
 |
shafi1990 |
Posted: Fri Sep 27, 2013 2:28 am Post subject: |
|
|
Newbie
Joined: 27 Sep 2013 Posts: 7
|
thanks for your reply.
I have followed a tutorial and have implemented each and every step of it but at last subscription is not working and I have just noticed that topic is also not subscribed using RFHUtil tool.
is there any special command to allow subscription?
Regards,
Muhammad Shafee |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Sep 27, 2013 2:36 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
This code subscribes to the broker flow monitoring publication. It also sends a reply to the subscription request. This is useful so that you can find out why the subscription request failed
Code: |
--
-- Copy the bits we need from the input message.
--
SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.MQMD = InputRoot.MQMD;
--
-- Create the RFH2 Folder.
--
CREATE LASTCHILD of OutputRoot DOMAIN 'MQRFH2';
--
-- Tell the MQMD that there is an RFH2 Header to follow.
--
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
-- Uncomment this line if you run into problems with the subscription
-- this will send a reply memssage to the *.SUBS.REPLY Queue.
-- RFHUTIL will then help you decode the data in the pscr section.
--
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
SET OutputRoot.MQMD.ReplyToQ = 'SERVICE.MONITORING.SUBS.REPLY';
SET OutputRoot.MQMD.ReplyToQMgr = QueueManagerName;
--
-- comment this out if you uncomment the two lines above
--SET OutputRoot.MQMD.Feedback = MQFB_NONE;
--
-- Now setup the RFH2 Header itself.
--
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = InputRoot.MQMD.CodedCharSetId;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = InputRoot.MQMD.CodedCharSetId;
--
-- Tha's the fixed field bits of the header setup
-- Now fill in the bits in the 'psc' section that tells the recipient that this is a Subscription Request
--
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
--
-- The next two lines allow this code to work on any environment.
--
SET OutputRoot.MQRFH2.psc.Topic = '$SYS/Broker/'|| BrokerName || '/Monitoring/#';
SET OutputRoot.MQRFH2.psc.QMgrName = QueueManagerName;
--
-- Finally, tell the publisher where we want the things delivered.
--
SET OutputRoot.MQRFH2.psc.QName = 'SERVICE.MONITORING.IN';
--
-- All Done.
--
|
What am I doing there that you aren't? _________________ 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 |
|
 |
shafi1990 |
Posted: Mon Sep 30, 2013 11:49 pm Post subject: |
|
|
Newbie
Joined: 27 Sep 2013 Posts: 7
|
Hi,
thanks for your reply and sorry for my late response.
I have used your given code accorging to my need as shown below:
Code: |
-- Copy the bits we need from the input message.
--
SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.MQMD = InputRoot.MQMD;
--
-- Create the RFH2 Folder.
--
CREATE LASTCHILD of OutputRoot DOMAIN 'MQRFH2';
--
-- Tell the MQMD that there is an RFH2 Header to follow.
--
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
-- Uncomment this line if you run into problems with the subscription
-- this will send a reply memssage to the *.SUBS.REPLY Queue.
-- RFHUTIL will then help you decode the data in the pscr section.
--
SET OutputRoot.MQMD.MsgType = MQMT_REQUEST;
SET OutputRoot.MQMD.ReplyToQ = 'Sub_ReplyToQ';
SET OutputRoot.MQMD.ReplyToQMgr = 'V8QM';
--
-- comment this out if you uncomment the two lines above
--SET OutputRoot.MQMD.Feedback = MQFB_NONE;
--
-- Now setup the RFH2 Header itself.
--
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = InputRoot.MQMD.CodedCharSetId;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = InputRoot.MQMD.CodedCharSetId;
--
-- Tha's the fixed field bits of the header setup
-- Now fill in the bits in the 'psc' section that tells the recipient that this is a Subscription Request
--
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
--
-- The next two lines allow this code to work on any environment.
--
SET OutputRoot.MQRFH2.psc.Topic = 'Order/All';
SET OutputRoot.MQRFH2.psc.QMgrName = 'V8QM';
SET OutputRoot.MQRFH2.psc.Filter = 'Root.XMLNSC.Order.OrderQuantity > 30';
--
-- Finally, tell the publisher where we want the things delivered.
--
SET OutputRoot.MQRFH2.psc.QName = 'OrderDQ';
--
-- All Done.
|
but it's also not working.
I can neither see message in SYSTEM.BROKER.CONTROL.QUEUE nor subscription in explorer .
Regards,
Shafee
Last edited by shafi1990 on Tue Oct 01, 2013 2:53 am; edited 1 time in total |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Oct 01, 2013 12:56 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Why did you remove the ReplyTo bits? They are there for a reason. i.e. The response message tells you what the problems were in the request.
Add a trace node after the compute node. set the output to ${Root}.
Post the result here.
Please enclose any code in code tags just like I do. It makes your post a lot easier to read. You can go back an edit it you know... _________________ 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 |
|
 |
shafi1990 |
Posted: Tue Oct 01, 2013 2:52 am Post subject: |
|
|
Newbie
Joined: 27 Sep 2013 Posts: 7
|
Thanks..
Following is the trace of tree just after the compute node :
Code: |
( ['MQROOT' : 0x16c32ea8]
(0x01000000:Name):Properties = ( ['MQPROPERTYPARSER' : 0x19b829f8]
(0x03000000:NameValue):MessageSet = '' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 546 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 437 (INTEGER)
(0x03000000:NameValue):Transactional = TRUE (BOOLEAN)
(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)
(0x03000000:NameValue):CreationTime = GMTTIMESTAMP '2013-10-01 10:45:27.100' (GMTTIMESTAMP)
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000:NameValue):Topic = 'Order/All' (CHARACTER)
(0x03000000:NameValue):ContentType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000:Name):MQMD = ( ['MQHMD' : 0x132e2a08]
(0x03000000:NameValue):SourceQueue = 'SUB_IN' (CHARACTER)
(0x03000000:NameValue):Transactional = TRUE (BOOLEAN)
(0x03000000:NameValue):Encoding = 546 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 437 (INTEGER)
(0x03000000:NameValue):Format = 'MQHRF2 ' (CHARACTER)
(0x03000000:NameValue):Version = 2 (INTEGER)
(0x03000000:NameValue):Report = 0 (INTEGER)
(0x03000000:NameValue):MsgType = 1 (INTEGER)
(0x03000000:NameValue):Expiry = -1 (INTEGER)
(0x03000000:NameValue):Feedback = 0 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):Persistence = 0 (INTEGER)
(0x03000000:NameValue):MsgId = X'414d51205638514d20202020202020205b544a5220004c0b' (BLOB)
(0x03000000:NameValue):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):BackoutCount = 0 (INTEGER)
(0x03000000:NameValue):ReplyToQ = 'Sub_ReplyToQ' (CHARACTER)
(0x03000000:NameValue):ReplyToQMgr = 'V8QM' (CHARACTER)
(0x03000000:NameValue):UserIdentifier = 'Administrato' (CHARACTER)
(0x03000000:NameValue):AccountingToken = X'16010515000000e9d1ebb944b6062a7a7747fbf401000000000000000000000b' (BLOB)
(0x03000000:NameValue):ApplIdentityData = ' ' (CHARACTER)
(0x03000000:NameValue):PutApplType = 11 (INTEGER)
(0x03000000:NameValue):PutApplName = '\Tools\ih03\ih03\rfhutil.exe' (CHARACTER)
(0x03000000:NameValue):PutDate = DATE '2013-10-01' (DATE)
(0x03000000:NameValue):PutTime = GMTTIME '10:45:27.100' (GMTTIME)
(0x03000000:NameValue):ApplOriginData = ' ' (CHARACTER)
(0x03000000:NameValue):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):MsgSeqNumber = 1 (INTEGER)
(0x03000000:NameValue):Offset = 0 (INTEGER)
(0x03000000:NameValue):MsgFlags = 0 (INTEGER)
(0x03000000:NameValue):OriginalLength = -1 (INTEGER)
)
(0x01000000:Name):MQRFH2 = ( ['MQHRF2' : 0x16d86e30]
(0x03000000:NameValue):Version = 2 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 437 (INTEGER)
(0x03000000:NameValue):Format = '' (CHARACTER)
(0x03000000:NameValue):NameValueCCSID = 437 (INTEGER)
(0x01000000:Name ):psc = (
(0x01000000:Name):Command = (
(0x02000000:Value): = 'RegSub' (CHARACTER)
)
(0x01000000:Name):Topic = (
(0x02000000:Value): = 'Order/All' (CHARACTER)
)
(0x01000000:Name):QMgrName = (
(0x02000000:Value): = 'V8QM' (CHARACTER)
)
(0x01000000:Name):Filter = (
(0x02000000:Value): = 'Root.XMLNSC.Order.OrderQuantity > 30' (CHARACTER)
)
(0x01000000:Name):QName = (
(0x02000000:Value): = 'OrderDQ' (CHARACTER)
)
)
)
)
|
Regarding the replyToQ bits, I have not changed anything just use them according to my need i=e change in Queue name and Qmanager name etc.
Regards,
Muhamamd Shafee |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Oct 01, 2013 3:35 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Why is the MQRFH2 Format field blank then?
Use the ReplyToQ until you get it to work. Without some indication of what is wrong you are guessing. The message that is sent to the ReplyToQ can help you debug the problem. _________________ 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 |
|
 |
|