Author |
Message
|
satayoday |
Posted: Tue Jun 30, 2009 10:51 pm Post subject: How to implement filter condition in Public subscribe....... |
|
|
Novice
Joined: 27 May 2007 Posts: 22
|
Hi All,
I am trying to mplement filtering condition in public subscribe.Can any one please guide me how to achive the target.
I tried with below mentioned option but did not worked.
In Subscriber messge flow
SET OutputRoot.MQRFH2.psc.Filter= 'user';
In publisher flow
SET OutputRoot.MQRFH2.psc.Filter= 'user';
but it is not working. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 30, 2009 11:21 pm Post subject: Re: How to implement filter condition in Public subscribe... |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
satayoday wrote: |
but it is not working. |
In what way? No messages published? No messages picked up by the subscriber? The wrong messages picked up by the subscriber? Error messages? Core dumps? Loud explosions?
Using what version of WMB? Running on what WMQ? On what platform?
Just saying "it's not working please help" is going to get the response "it's broken some how, need to fix it". Better information, better advice. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
satayoday |
Posted: Tue Jun 30, 2009 11:32 pm Post subject: In what way? No messages published? N |
|
|
Novice
Joined: 27 May 2007 Posts: 22
|
Subscriber flow:-
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.Topic=InputRoot.XML.topic;
SET OutputRoot.MQRFH2.psc.QMgrName ='WBRK6_DEFAULT_QUEUE_MANAGER';
SET OutputRoot.MQRFH2.psc.QName= 'PublishQueue';
SET OutputRoot.MQRFH2.psc.Filter= '(Body.Publish.data) >= 100';
Publisher Flow
SET OutputRoot.MQMD.ReplyToQ = 'RTOQ';
SET OutputRoot.MQMD.Format= MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.psc.Topic=InputRoot.XML.Publish.topic;
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='Publish';
SET OutputRoot."BLOB"."BLOB"=BITSTREAM(InputRoot.XML.Publish.data);
SET OutputRoot.MQRFH2.psc.Filter= InputRoot.XML.Publish.data;
SET OutputRoot.MQRFH2.mcd = NULL ;
Subscriber message:-
<topic>fruits</topic>
Publish me<Publish><topic>fruits</topic><data>150</data></Publish>ssage:- |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 30, 2009 11:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Aside from the many dubious aspects of your code (some quite frightening) what exactly is the problem? I'm guessing we've ruled out loud explosions, but what happens (or doesn't happen) when you execute this monster?
(And executing it, with an axe, is not a bad idea!) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
satayoday |
Posted: Tue Jun 30, 2009 11:53 pm Post subject: what exactly is the problem? |
|
|
Novice
Joined: 27 May 2007 Posts: 22
|
I am able to run this flow by registering without filter condition only with topic.But when i applied filter condition it is not working.
Any idea wherei will get the error i debugged the flow it is passing till publication node after that nothing happining. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 30, 2009 11:58 pm Post subject: Re: what exactly is the problem? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
satayoday wrote: |
But when i applied filter condition it is not working. |
Vitor wrote: |
In what way? No messages published? No messages picked up by the subscriber? The wrong messages picked up by the subscriber? Error messages? |
satayoday wrote: |
Any idea wherei will get the error |
I'm not even going to comment on your code.
satayoday wrote: |
i debugged the flow it is passing till publication node after that nothing happining. |
As is the much repeated advice in this forum, take a user trace rather than use the debugger. You get far more information. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 01, 2009 12:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So I see you have a replyto destination in the MQMD.
What is the pscr message you receive there upon publish?
Quote: |
SET OutputRoot."BLOB"."BLOB"=BITSTREAM(InputRoot.XML.Publish.data);
SET OutputRoot.MQRFH2.psc.Filter= InputRoot.XML.Publish.data; |
I sure hope that there is an error here somewhere. As said previously the user trace will tell you much more...
Aside from the fact that the XML domain is deprecated, why would the payload reference be the filter and not the BLOB of the payload reference?
Looking at the fact that the subscriber filter seems to reference specific fields in the message Body we have a few counter-productive lines of code in the publisher:
Why reference anything in the filter on the publish operation? Do not even create the folder... And by the way I did not verify the doc but you better, and make sure the filter folder and syntax you used is the right way to go for the subscriber, and publisher!!! Wouldn't using a BLOB on OutputRoot be counter-productive as to the filtering capability which does expect some kind of a tree to be available?
And what about subscription point? I seem to remember that filtering was done through subscription points? But then that is just me... and I have never used filtering or subscription points in pub/sub.
Maybe a passing IBMer can help clear up this mess.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|