Author |
Message
|
novato |
Posted: Wed Mar 21, 2012 1:15 pm Post subject: ESQL in Pub/Sub |
|
|
Novice
Joined: 14 Mar 2012 Posts: 13
|
Hi ,
I have been trying to a publish to a topix 'XYZ'. There are 5 subscribers to it with 5 different queues. When I use the subscriber without any selectors in the definition messages are getting published to all the queuues. But if I use a selector with proper message content, messages are getting published properly but not reaching the queues.
Here is a sample subscription I have used. Let me know if I am wrong in the definition
define sub(SUBNAME) dest(QNAME) SELECTOR('(Root.EMPRECORD.EMPNAME .DESIGNATION = ''MANAGER'' OR ''MGR'' AND (Root.EMPRECORD.EMPNAME.AGE > ''30'')') |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 21, 2012 5:48 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So when you publish send a request message and monitor the reply to queue. There will be a reply message giving you information about the status of the publish. Depending on your topic and subscription setup, your distribution may be everybody or nobody. Now you need to find out what is wrong with the subscriptions... More hints in the reply message.
Maybe because there does not seem to be a topicstr or a topic object in your subscription??
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
novato |
Posted: Wed Mar 21, 2012 5:59 pm Post subject: |
|
|
Novice
Joined: 14 Mar 2012 Posts: 13
|
This is just a datagram publication. As mentioned earlier , the messages goes to all queues when selector is not given. I was wondering if there is any issue with the SUB definition. When I display the sub ,it is referring to the right topic and topicstring.
Not sure where is the problem |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 21, 2012 6:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
novato wrote: |
This is just a datagram publication. As mentioned earlier , the messages goes to all queues when selector is not given. I was wondering if there is any issue with the SUB definition. When I display the sub ,it is referring to the right topic and topicstring.
Not sure where is the problem |
Switch the datagram to a request reply publication and look for the reply message (use dummys created with RFHUtil). Read the reply with RFHUtil.
A lot more information that way  _________________ MQ & Broker admin |
|
Back to top |
|
 |
novato |
Posted: Wed Mar 21, 2012 7:54 pm Post subject: |
|
|
Novice
Joined: 14 Mar 2012 Posts: 13
|
I tried this one. I did not get any messages in the ReplyToQ. But could see that when published from RFHUtil with Selectors as above , I am getting the below error
' *Error cc=2 rc=2554 Cannot Put' . I checked the error , it says MQRC_CONTENT_ERROR. But not able to find what is wrong with the content
 |
|
Back to top |
|
 |
novato |
Posted: Wed Mar 21, 2012 8:13 pm Post subject: |
|
|
Novice
Joined: 14 Mar 2012 Posts: 13
|
Is it mandatory to use MQRFH2 header for pub/sub? |
|
Back to top |
|
 |
novato |
Posted: Thu Mar 22, 2012 12:05 am Post subject: |
|
|
Novice
Joined: 14 Mar 2012 Posts: 13
|
I could resolve the Selector issue. But now when messages are published,it is neither giving any error nor reaching the SUB queues though the content is valid
Any help would be appreciated. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 22, 2012 5:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
novato wrote: |
Is it mandatory to use MQRFH2 header for pub/sub? |
In WMQv7 you don't use RFH2 at all. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
novato |
Posted: Thu Mar 22, 2012 6:04 am Post subject: |
|
|
Novice
Joined: 14 Mar 2012 Posts: 13
|
Ok. Then can anyone help me find what am I missing here. Input XML is
<?xml version="1.0" encoding="UTF-8" ?>
<EMPRECORD>
<EMPNAME>
<DESIGNATION>MGR</DESIGNATION>
<AGE>35</AGE>
</EMPNAME>
</EMPRECORD>
i tried giving XMLNSC in the definition. Still no luck
define sub(SUBNAME) dest(QNAME) SELECTOR('(Root.XMLNSC.EMPRECORD.EMPNAME .DESIGNATION = ''MANAGER'' OR ''MGR'' AND (Root.XMLNSC.EMPRECORD.EMPNAME.AGE > ''30'')') |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 22, 2012 6:12 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I don't think you can use the OR like that?
I think you have to have something like
Code: |
(Root.XMLNSC.EMPRECORD.EMPNAME .DESIGNATION = ''MANAGER'' OR Root.XMLNSC.EMPRECORD.EMPNAME .DESIGNATION = '''MGR'' AND (Root.XMLNSC.EMPRECORD.EMPNAME.AGE > ''30'' |
And you might then need to put the OR clause into it's own () to ensure the correct precedence of operation. |
|
Back to top |
|
 |
novato |
Posted: Thu Mar 22, 2012 6:17 am Post subject: |
|
|
Novice
Joined: 14 Mar 2012 Posts: 13
|
Thanks mqjeff. I tried this one now. I am able to publish properly now. But still no messages in any of the subscription queues. |
|
Back to top |
|
 |
novato |
Posted: Thu Mar 22, 2012 2:01 pm Post subject: |
|
|
Novice
Joined: 14 Mar 2012 Posts: 13
|
This is working now !! Not sure someone had missed out 'XMLNSC' during implementation though it was present in the scripts..
Thanks a lot for all your help
 |
|
Back to top |
|
 |
|