ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » ESQL in Pub/Sub

Post new topic  Reply to topic
 ESQL in Pub/Sub « View previous topic :: View next topic » 
Author Message
novato
PostPosted: Wed Mar 21, 2012 1:15 pm    Post subject: ESQL in Pub/Sub Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 21, 2012 5:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
novato
PostPosted: Wed Mar 21, 2012 5:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 21, 2012 6:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
novato
PostPosted: Wed Mar 21, 2012 7:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
novato
PostPosted: Wed Mar 21, 2012 8:13 pm    Post subject: Reply with quote

Novice

Joined: 14 Mar 2012
Posts: 13

Is it mandatory to use MQRFH2 header for pub/sub?
Back to top
View user's profile Send private message
novato
PostPosted: Thu Mar 22, 2012 12:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Mar 22, 2012 5:20 am    Post subject: Reply with quote

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
View user's profile Send private message
novato
PostPosted: Thu Mar 22, 2012 6:04 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Thu Mar 22, 2012 6:12 am    Post subject: Reply with quote

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
View user's profile Send private message
novato
PostPosted: Thu Mar 22, 2012 6:17 am    Post subject: Reply with quote

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
View user's profile Send private message
novato
PostPosted: Thu Mar 22, 2012 2:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » ESQL in Pub/Sub
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.