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 » WebSphere Message Broker (ACE) Support » WMB/MQ subscriptions with content filter

Post new topic  Reply to topic Goto page 1, 2  Next
 WMB/MQ subscriptions with content filter « View previous topic :: View next topic » 
Author Message
jdevassy
PostPosted: Wed Apr 02, 2008 10:40 pm    Post subject: WMB/MQ subscriptions with content filter Reply with quote

Apprentice

Joined: 16 Oct 2005
Posts: 37
Location: Melbourne, Australia

Hi,
I am usinf MWB pub sub to subscribe to messages. it works ok with just the topic name.

But I want to subscribe with same topic name + content based filter. ie I want to get messages for that topic with a particular value in the message body. I am using RFHUtil to do subscriptions for the queue.

Could anyone tell me how to set the filter for this subscription. The message I use is like this and the value to filter the message is: 'MyVale' = ABC.

<wsnt:Notify xsi:schemaLocation="http://docs.oasis-open.org/wsn/b-2 b-2.xsd" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsad="http://www.w3.org/2005/08/addressing" xmlns:tr="http://www.immi.gov.au/Namespace/TRIPS/Messages/V2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nbts="urn:xml-gov-au:immi:codes:wsnt-topic-space:SFP-IS-NotificationBroker:1.0">
<wsnt:NotificationMessage>
<wsnt:Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">Sample Topic</wsnt:Topic>
<wsnt:ProducerReference>
<wsad:Address>http://www.immi.gov.au/Namespace/PermanentSystemAddresses/</wsad:Address>
</wsnt:ProducerReference>
<wsnt:Message>
<MyMessage>
<MyValue>ABC</MyValue></MyMessage>
</wsnt:Message>
</wsnt:NotificationMessage>
</wsnt:Notify>

thanks
jo
_________________
Thanks & Regards,

Joy Paliakkara Devassy
Back to top
View user's profile Send private message Yahoo Messenger
marcin.kasinski
PostPosted: Thu Apr 03, 2008 12:32 am    Post subject: Re: WMB/MQ subscriptions with content filter Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

jdevassy wrote:
Hi,
I am usinf MWB pub sub to subscribe to messages. it works ok with just the topic name.

But I want to subscribe with same topic name + content based filter. ie I want to get messages for that topic with a particular value in the message body. I am using RFHUtil to do subscriptions for the queue.

Could anyone tell me how to set the filter for this subscription. The message I use is like this and the value to filter the message is: 'MyVale' = ABC.

<wsnt:Notify xsi:schemaLocation="http://docs.oasis-open.org/wsn/b-2 b-2.xsd" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsad="http://www.w3.org/2005/08/addressing" xmlns:tr="http://www.immi.gov.au/Namespace/TRIPS/Messages/V2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nbts="urn:xml-gov-au:immi:codes:wsnt-topic-space:SFP-IS-NotificationBroker:1.0">
<wsnt:NotificationMessage>
<wsnt:Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">Sample Topic</wsnt:Topic>
<wsnt:ProducerReference>
<wsad:Address>http://www.immi.gov.au/Namespace/PermanentSystemAddresses/</wsad:Address>
</wsnt:ProducerReference>
<wsnt:Message>
<MyMessage>
<MyValue>ABC</MyValue></MyMessage>
</wsnt:Message>
</wsnt:NotificationMessage>
</wsnt:Notify>

thanks
jo


Quote:

"JMS provides a mechanism to select a subset of the messages on a queue so that
this subset is returned by a receive call. When creating a QueueReceiver, you can
provide a string that contains an SQL (Structured Query Language) expression to
determine which messages to retrieve. The selector can refer to fields in the JMS
message header as well as fields in the message properties (these are effectively
application-defined header fields)."



It means that you can not filter by your XML field.

...but this field you can use as parameter in publisher



Code:
PublishMessage.setStringProperty("MyValue","ABC");



and use as selector in subscriber


Code:
topicSubscriber = topicSession.createSubscriber(topic, "MyValue=ABC", false);

_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
jdevassy
PostPosted: Thu Apr 03, 2008 2:01 am    Post subject: Reply with quote

Apprentice

Joined: 16 Oct 2005
Posts: 37
Location: Melbourne, Australia

thanks heaps for a fast reply.

Does it mean that the content based filtering is not possible with XML publications?

what if the message format is changed to MQSTR instead of XML.

thanks
jo
Back to top
View user's profile Send private message Yahoo Messenger
jdevassy
PostPosted: Thu Apr 03, 2008 2:13 am    Post subject: Reply with quote

Apprentice

Joined: 16 Oct 2005
Posts: 37
Location: Melbourne, Australia

And also I am using MQ subscription.


thanks
jo
Back to top
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Thu Apr 03, 2008 2:20 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

jdevassy wrote:
And also I am using MQ subscription.


In the original post, you said you were using WMB rather than MQ subscription. Am I missing a point here?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jdevassy
PostPosted: Thu Apr 03, 2008 11:20 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Oct 2005
Posts: 37
Location: Melbourne, Australia

Sorry for the confusion.

I am using WMB publish node to publish the message and the subscriptions are done on MQ queues. I am using RFHUtil to do the MQ subscription. It works just with the topic name. There is an option in the RFHUtil to give the filter, but I am not able to get it wotking.
Back to top
View user's profile Send private message Yahoo Messenger
fjb_saper
PostPosted: Fri Apr 04, 2008 3:10 am    Post subject: Re: WMB/MQ subscriptions with content filter Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

marcin.kasinski wrote:
Quote:

"JMS provides a mechanism to select a subset of the messages on a queue so that
this subset is returned by a receive call. When creating a QueueReceiver, you can
provide a string that contains an SQL (Structured Query Language) expression to
determine which messages to retrieve. The selector can refer to fields in the JMS
message header as well as fields in the message properties (these are effectively
application-defined header fields)."



It means that you can not filter by your XML field.

...but this field you can use as parameter in publisher



Code:
PublishMessage.setStringProperty("MyValue","ABC");



and use as selector in subscriber


Code:
topicSubscriber = topicSession.createSubscriber(topic, "MyValue=ABC", false);


Realize however that you now have a selector that looks neither at MessageId nor at CorrelationId (potential performance problem).

I would not recommend this solution because of performance problems.
Rather take all messages from the subscription and look at the property. Discard the ones of no interest...

Have you looked at MessageBroker subscription Point?

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
AkankshA
PostPosted: Fri Apr 04, 2008 3:20 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/aq19890_.htm
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
PeterPotkay
PostPosted: Fri Apr 04, 2008 10:45 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Moved to WMB Forum
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Fri Apr 04, 2008 12:14 pm    Post subject: Re: WMB/MQ subscriptions with content filter Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

fjb_saper wrote:


Have you looked at MessageBroker subscription Point?




I've never had to use subscription Point.
I always use default subscription Point.

PS.
How to set subscription Point in my JMS subscription application if JMS use RFH not RFH2 in subscription message.
I use JMS app and MBv6.1 can not find it.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Fri Apr 04, 2008 2:05 pm    Post subject: Re: WMB/MQ subscriptions with content filter Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

marcin.kasinski wrote:
fjb_saper wrote:


Have you looked at MessageBroker subscription Point?




I've never had to use subscription Point.
I always use default subscription Point.

PS.
How to set subscription Point in my JMS subscription application if JMS use RFH not RFH2 in subscription message.
I use JMS app and MBv6.1 can not find it.


MBV6.1 and RFH not RFH2?? How is that working out for you? Well this is just one more reason go look for the RFH2
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jdevassy
PostPosted: Fri Apr 04, 2008 3:58 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Oct 2005
Posts: 37
Location: Melbourne, Australia

thnka you all for the replies.

I havent looked at the WMB subscription point. At the momeent MB publishes to the default location.

Apparently the best solution is to do a custom filtering of the messages.


Thanks
Jo
Back to top
View user's profile Send private message Yahoo Messenger
marcin.kasinski
PostPosted: Fri Apr 04, 2008 10:45 pm    Post subject: Re: WMB/MQ subscriptions with content filter Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

fjb_saper wrote:

MBV6.1 and RFH not RFH2?? How is that working out for you? Well this is just one more reason go look for the RFH2



But still there is open question:

How to set subscription Point in my JMS subscription application ?

How to register subscription with custom subscription Point ?

I was thinking about sending subscription request to broker queue. Then in this flow I could change FRH into RFH2 and add subscription point and send this converted message to SYSTEM.BROKER.CONTROL.QUEUE queue.

Is there better way ?
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Sat Apr 05, 2008 6:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Have you looked at the publish node?


_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
marcin.kasinski
PostPosted: Sat Apr 05, 2008 6:37 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

fjb_saper wrote:
Have you looked at the publish node?




Publishing is not a problem but I was asking about register subscription .

Quote:
How to register subscription with custom subscription Point ?


I have problem only with register subscription message.

My question is how to set subscription Point during subscribing to a topic in my JMS JAVA code.


Code:
TopicSubscriber tSub = tSess.createDurableSubscriber(t, "A");

_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » WMB/MQ subscriptions with content filter
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.