Author |
Message
|
vinod_sri |
Posted: Wed Aug 16, 2006 5:42 am Post subject: Timer Node for deleting messages |
|
|
Apprentice
Joined: 10 Dec 2003 Posts: 42 Location: Atlanta
|
Hi,
I have come across a situation wherein I have to implement a purge process for a table that will run regularly to purge rows from a table with XXX_DATETIME that's more than 7 days old. To achieve this I need to write/modify a message flow. It will be a "timer node", waking up every 15 minutes. It should wake up and delete all records in this table greater than 7 days old. I am working on WBI 6, WMQ 6 and DB2 8.2. Can anyone please advice me how to achieve this and provide me a sample code if possible? This is something urgent.
Thanks a lot
Sri. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 16, 2006 5:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I used to do this kind of purge as a stored procedure that was run everytime someone did an insert. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vinod_sri |
Posted: Wed Aug 16, 2006 5:57 am Post subject: Timer Node for deleting messages |
|
|
Apprentice
Joined: 10 Dec 2003 Posts: 42 Location: Atlanta
|
Hi Jeff,
Thanks for the reply. I am not good in writing the stored procedures. Can you help me providing the logic or some sample code. Pl. do not think I am lazy. I haven't done much work in writing SPs.
Thanks a lot
Sri |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 16, 2006 6:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I just did a delete statement, and stuck it into a sample insert trigger.
I don't have any sample code - it's been about five years and there's no guarantee that the database was the same.
And there's nothing wrong with the way you were going to do it - I'm just suggesting an alternative. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Wed Aug 16, 2006 9:51 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
why do you need sample code for something so simple?
just put a database node after the timer and put a delete statement based on date!!
are u new to broker??
also, if you want to delete stuff that is 7 days old, why does the timer need to trigger every 15 mins, you are not gonna find something new to delete that fast ... it should be atleast a day to make sense ..... just a thought!!!
--madi |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 16, 2006 9:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If rows are inserted every minute, then every minute after the first 10080 (unless my math has failed me) minutes there will be a new row that is more than 7 days old.
So every 15 minutes there would be fifteen messages that are more than 7 days old. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Wed Aug 16, 2006 10:02 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
oh ok ... "Grand Poobah"
i was thinking may be he would check the insert date and delete everything thats 7 days old ...
--madi |
|
Back to top |
|
 |
vinod_sri |
Posted: Wed Aug 16, 2006 10:13 am Post subject: Timer Node for deleting messages |
|
|
Apprentice
Joined: 10 Dec 2003 Posts: 42 Location: Atlanta
|
Thanks folks,
Madi, I am new to Message Broker 6. When you mentioned about inserting the database node after the timer, are you referring to the TimeoutControl Node/ TimeoutNotification Node or something else? Please explain to me in litte more detail.
As Jefferey said, we planned to set 15min b'cse the no.of messages coming in per munite will be somewhere around high 100's.
Thanks again for the quick replies.
Vinod |
|
Back to top |
|
 |
madi |
Posted: Wed Aug 16, 2006 10:35 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
a time out notification ofcourse
then have a database node and put something like this in it
delete from whatever.whatever where whatever > CURRENT DATE - seven days
use the help in the broker toolkit ....... that can you better answers than us
--madi |
|
Back to top |
|
 |
ydsk |
Posted: Wed Aug 16, 2006 2:10 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Vinod_Sri,
I believe there is very good aticle on timer nodes in v6.
Search in www.ibm.com.
I saw it a few weeks back.
It should give you all the info you need.
If you can post the link here when you find it, it might help others in the forum.
Moderator may want to make the link sticky.
Thanks.
ydsk. |
|
Back to top |
|
 |
ydsk |
Posted: Wed Aug 16, 2006 2:19 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
|
Back to top |
|
 |
vinod_sri |
Posted: Thu Aug 17, 2006 6:45 am Post subject: Timer Node for deleting messages |
|
|
Apprentice
Joined: 10 Dec 2003 Posts: 42 Location: Atlanta
|
Thanks Folks.
All the suggestions are very valuable.
Madi, I Just designed a message flow as you said.
TimeoutNotification ---> Compute Node ---> MQOutput
It works as expected.
YDSK, Thanks for the Link. It describes everything about timernode in detail.
Thanks again
Vinod |
|
Back to top |
|
 |
|