ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Delete messages in a range

Post new topic  Reply to topic
 Delete messages in a range « View previous topic :: View next topic » 
Author Message
graigue61
PostPosted: Wed Nov 15, 2006 4:51 am    Post subject: Delete messages in a range Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Nov 15, 2006 4:56 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Nov 15, 2006 5:02 am    Post subject: Reply with quote

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
View user's profile Send private message
graigue61
PostPosted: Fri Nov 24, 2006 12:53 am    Post subject: delete messages in a range Reply with quote

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
View user's profile Send private message
sneh
PostPosted: Wed Nov 29, 2006 6:07 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Nov 29, 2006 6:07 am    Post subject: Reply with quote

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
View user's profile Send private message
dkeister
PostPosted: Fri Dec 01, 2006 11:41 am    Post subject: Reply with quote

Disciple

Joined: 25 Mar 2002
Posts: 184
Location: Purchase, New York

MQExerciser will do what you want.
_________________
Dean Keister
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Delete messages in a range
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.