Author |
Message
|
graigue61 |
Posted: Wed Nov 15, 2006 4:51 am Post subject: Delete messages in a range |
|
|
Newbie
Joined: 07 Nov 2006 Posts: 9 Location: Ireland
|
Hi,
I have a log queue that keeps a copy of messages that go into an application. I recommended dumping & clearing the queue on a regular basis to the project team when I did the handover. However, this wasn't done and now they have come back and want me to clear the log queue of the first 3000 messages and leaving the last 500 messages. Is there a way I can do this at the runmqsc command line ? i.e. specify a range from 1-3000 (queue position) or even a date i.e. messages put before 11/01/2006 ?
I'd like to do it at the command line because I'd like to schedule this in the windows scheduler on a regular basis. Its MQ series version 5.3 on windows.
Any ideas will be greatfully appreciated. _________________ Lisa |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 15, 2006 4:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Not from runmqsc I think, though you could create a new queue, move 3000 messages to the other queue with the support pack, then flush the new queue.
I think that'd achieve what you were looking for. Theoretically you could script it... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 15, 2006 5:02 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
A simple modification to the sample code for amqsget to cause it to read only the first byte and ignore truncated messages will give you something that will do a destructive get on the first message in the queue and you can run from the command line.
The MA01 support pack may also be helpful.
Using a queue for a log like this is not best practices.
Changing the process that puts the messages to the log queue to specify an EXPIRY is a better option than deleting the first X messages on the queue.
Writing a program to read the log queue and insert the messages into a database, and then managing the database is a better option than using EXPIRY. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
graigue61 |
Posted: Fri Nov 24, 2006 12:53 am Post subject: delete messages in a range |
|
|
Newbie
Joined: 07 Nov 2006 Posts: 9 Location: Ireland
|
Hi, I used the Q! tool and it does exactly what I'm looking for. Many thanks to all your advice ! _________________ Lisa |
|
Back to top |
|
 |
sneh |
Posted: Wed Nov 29, 2006 6:07 am Post subject: |
|
|
Apprentice
Joined: 12 Aug 2006 Posts: 28 Location: Mumbai
|
can u tell me wat tool is tht?
n where from u got it? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 29, 2006 6:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
jefflowrey wrote: |
The MA01 support pack may also be helpful. |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
dkeister |
Posted: Fri Dec 01, 2006 11:41 am Post subject: |
|
|
Disciple
Joined: 25 Mar 2002 Posts: 184 Location: Purchase, New York
|
MQExerciser will do what you want. _________________ Dean Keister |
|
Back to top |
|
 |
|