Author |
Message
|
Shailesh |
Posted: Wed Apr 24, 2002 11:25 am Post subject: |
|
|
Newbie
Joined: 23 Apr 2002 Posts: 3 Location: New York
|
How can I delete old messages in my queue without reading them. For reading I have to Get those messages and when I do this I'm actually removing the message from the queue. If I'm putting that message into the queue back it is no more an old message. Any suggestion.........?? |
|
Back to top |
|
 |
jeeth_m |
Posted: Wed Apr 24, 2002 11:43 am Post subject: |
|
|
Voyager
Joined: 21 Jan 2002 Posts: 93
|
use CLEAR QLOCAL(q name) this will remove the messages in the Q.
is this what u were looking for? |
|
Back to top |
|
 |
Shailesh |
Posted: Wed Apr 24, 2002 12:40 pm Post subject: |
|
|
Newbie
Joined: 23 Apr 2002 Posts: 3 Location: New York
|
No. Actually, say I've 10 messages and I've to delete a few messages depending on the date. For e.g. if the messages are 5 day old then delete them. Now to find out that how old a message is I've to Dequeue the message from the Queue. If the message is not old enough I've to put it back to the Queue. But if I'll enqueue the message it will become a new message as the date and time stamp of the message will change. I want to acheive this using Visual Basic. |
|
Back to top |
|
 |
crojas |
Posted: Wed Apr 24, 2002 12:49 pm Post subject: |
|
|
Apprentice
Joined: 10 Mar 2002 Posts: 28
|
I think you have 2 options:
1.- Make applications using expity option to 5 days, so you don't have to mantain the system.
If you can't:
2.- Build a program that get a message using the BROWSE, and just GET_UNDER_CURSOR the messages that are older than you want.
Regards |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Apr 25, 2002 3:47 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
The date and time stamp do not have to change. These two fields are part of the origin context, which you can set yourself. When you reput the message, set the MQPMO_SET_ALL_CONTEXT option.
But if your logic is only going to say "Hey is this message older than n days? If yes, get rid of it." why bother? Set the EXPIRY value accordingly and let MQ delete these messages for you.
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
Shailesh |
Posted: Thu Apr 25, 2002 5:15 am Post subject: |
|
|
Newbie
Joined: 23 Apr 2002 Posts: 3 Location: New York
|
Thanks a lot!!! This solves the purpose. |
|
Back to top |
|
 |
|