Author |
Message
|
ayanc |
Posted: Mon Dec 20, 2004 4:10 am Post subject: Using Content Based Filtering for Publications (v2.1) |
|
|
Voyager
Joined: 15 Nov 2004 Posts: 88
|
Hi All,
I am trying to use content based filtering for selecting specific publications, in WMQI 2.1 (CSD 07).
In the subscription node, I have written the following code:
SET OutputRoot.MQMD.Format = 'MQHRF2';
SET OutputRoot.MQRFH2.psc.Command = 'RegSub';
SET OutputRoot.MQRFH2.psc.Topic = 'Science';
SET OutputRoot.MQRFH2.psc.QName = 'SUBSCRIBER.QUEUE';
SET OutputRoot.MQRFH2.psc.Filter = "InputBody"."Book"."Title" LIKE 'N%';
SET OutputRoot.MRM = InputBody;
The message structure is as follows:
<?xml version="1.0" ?>
<Lib>
<Book>
<Title>Cosmos</Title>
<Author>Carl Sagan</Author>
<Published>2004-12-18 11:25:00</Published>
</Book>
</Lib>
My Objective is to allow all those messages whose Published date field is within two days ahead from current date.
But for experimenting the filter condition, I tried to allow all those messages whose names start with the letter 'N' (say).
The problem is, it sends all the messages to the subscription queue. In other words the filter condition is not working properly.
The pdf files indicate the use of the following example:
Body.Name LIKE 'C%'
But when I use "Body"."Book"."Title" LIKE 'N%' then it doesnt deploy and gives me a error stating that correlation name "Body" is not valid.
Can anyone help?
Thanks.
Ayan. |
|
Back to top |
|
 |
ayanc |
Posted: Mon Dec 20, 2004 10:30 pm Post subject: |
|
|
Voyager
Joined: 15 Nov 2004 Posts: 88
|
Hi,
I have found out a solution to filter all Title values starting with the character 'N', and it is working. Now I will try to use the date fields.
Thanks. |
|
Back to top |
|
 |
ayanc |
Posted: Wed Dec 22, 2004 3:50 am Post subject: |
|
|
Voyager
Joined: 15 Nov 2004 Posts: 88
|
Hi All,
I failed implementing filter condition using date fields. Actually I have not been able to find out how to use variables as part of filter condition.
I have tried two types of solutions:
Case1:
SET OutputRoot.MQRFH2.psc.Filter = 'CAST(SUBSTRING(TRIM(Body.Book.Published) FROM 1 FOR 10) AS DATE) <= (CURRENT_DATE + INTERVAL ''2'' DAY)';
Case2:
SET PUBDT = CAST(SUBSTRING(TRIM("InputBody"."Book"."Published") FROM 1 FOR 10) AS DATE) ;
SET REFDT = CURRENT_DATE + INTERVAL '2' DAY;
. .. ..
.. .. ..
SET OutputRoot.MQRFH2.psc.Filter = 'PUBDT <= REFDT';
But in both the cases, I observed there was no error reported. The trace files are also clean.
In Case1:
No subscription is registered and nothing works.
In Case2:
A subscription is registered with content filter as PUBDT <= REFDT, but again it doesnt work.
Can any body bail me out?
I wonder if it is possible to use variables in filter conditions.
Thanks.
Ayan. |
|
Back to top |
|
 |
paustin_ours |
Posted: Mon Nov 28, 2005 3:20 pm Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
i dint even get past your first step, i would appriciate it if you could take the time to explain what got your first step working.
thanks. |
|
Back to top |
|
 |
EddieA |
Posted: Mon Nov 28, 2005 3:51 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
Posted: 22 Dec 2004 11:50 |
I hope they're not still waiting for a reply.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
paustin_ours |
Posted: Tue Nov 29, 2005 8:27 am Post subject: |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
maybe i was a little too optimistic, thought i'll get an answer if the person was a frequent visitor. guess not. |
|
Back to top |
|
 |
EddieA |
Posted: Tue Nov 29, 2005 11:11 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Perhaps if you actually descibed your problem, in detail, together with what you've already tried, we might be able to help.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|