Author |
Message
|
kodiakk |
Posted: Wed Jun 17, 2009 8:33 am Post subject: How do I clear SOME of the messages from a local queue? |
|
|
Acolyte
Joined: 04 Dec 2007 Posts: 58 Location: Jacksonville, Fl.
|
I have a situation where my client would like for me to remove the first 23 messages from a queue. I know that there USED to be some sort of destructive get command (amqsget?) that would allow you to specify the number of messages to get. It may have even been a destructive browse (amqsbrowse?)
I'm currently in a Windows environment, running MQ version 6.0.24. I am comfortable using either the command line or GUI, but I am simply not having any luck finding a way to PARTIALLY clear the queue... it seems to be all or nothing.
Any help would be greatly appreciated.
Thanks! _________________ "Don't take life too seriously... you won't get out of it alive..." |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 17, 2009 9:39 am Post subject: Re: How do I clear SOME of the messages from a local queue? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kodiakk wrote: |
I know that there USED to be some sort of destructive get command (amqsget?) that would allow you to specify the number of messages to get. |
AFAIK amqsget (which isn't a command, but a sample application) has always destructively read all the messages from a queue as supplied by IBM; if you encountered a modified version then that might do anything.
kodiakk wrote: |
It may have even been a destructive browse (amqsbrowse?) |
A destructive browse is a contradiction in terms, but amqsbcg still exists (again a sample not a command)
kodiakk wrote: |
I'm currently in a Windows environment, running MQ version 6.0.24. I am comfortable using either the command line or GUI, but I am simply not having any luck finding a way to PARTIALLY clear the queue... it seems to be all or nothing. |
You could use something like qload to unload the entire queue, delete the messages from the file, then reload the queue.
Or modify amqsget to take a parameter of how many message to read. Easy enough change. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jeevan |
Posted: Wed Jun 17, 2009 10:22 am Post subject: Re: How do I clear SOME of the messages from a local queue? |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
Vitor wrote: |
kodiakk wrote: |
I know that there USED to be some sort of destructive get command (amqsget?) that would allow you to specify the number of messages to get. |
AFAIK amqsget (which isn't a command, but a sample application) has always destructively read all the messages from a queue as supplied by IBM; if you encountered a modified version then that might do anything.
kodiakk wrote: |
It may have even been a destructive browse (amqsbrowse?) |
A destructive browse is a contradiction in terms, but amqsbcg still exists (again a sample not a command)
kodiakk wrote: |
I'm currently in a Windows environment, running MQ version 6.0.24. I am comfortable using either the command line or GUI, but I am simply not having any luck finding a way to PARTIALLY clear the queue... it seems to be all or nothing. |
You could use something like qload to unload the entire queue, delete the messages from the file, then reload the queue.
Or modify amqsget to take a parameter of how many message to read. Easy enough change. |
Also, if you have any monitoring tools such as BMC Patrol, you can look at and delete message one by one or a number of message at one time or copy or move to another queue. |
|
Back to top |
|
 |
kodiakk |
Posted: Wed Jun 17, 2009 10:29 am Post subject: |
|
|
Acolyte
Joined: 04 Dec 2007 Posts: 58 Location: Jacksonville, Fl.
|
Unfortunately, this environment is still in the DEV/TEST phase, so no monitoring tools are implimented yet. I just seem to recall that there was a single command (or sample application) that would perform this, and allow a flag to designate a range of numbers to utilize... I'm just hoping that it's not an "all or nothing" scenario where this is concerned.
Thanks! _________________ "Don't take life too seriously... you won't get out of it alive..." |
|
Back to top |
|
 |
zpat |
Posted: Wed Jun 17, 2009 10:34 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
MO71 can unload a queue with 'purge' and a range of messages can be chosen (23 specified as '0..22').
See the unload option against a queue - you can unload (purge) to a file and then discard the file. |
|
Back to top |
|
 |
kodiakk |
Posted: Wed Jun 17, 2009 10:50 am Post subject: |
|
|
Acolyte
Joined: 04 Dec 2007 Posts: 58 Location: Jacksonville, Fl.
|
Thank you Zpat! It's not quite what I remember, but it's effective, non-the-less!
Actually, if you simply browse the queues, there's a DELETE button in there that will allow you to select as many items as you want, and get rid of them that way as well.
Again, thank you! _________________ "Don't take life too seriously... you won't get out of it alive..." |
|
Back to top |
|
 |
zpat |
Posted: Wed Jun 17, 2009 11:13 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
MO71 does almost everything.
The author Paul Clarke is presenting a session on support pacs at the next MQ user group at Hursley UK, July 1st.
www.mqug.org.uk |
|
Back to top |
|
 |
Sam Uppu |
Posted: Wed Jun 17, 2009 12:52 pm Post subject: |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
You can also use rfhutil to browse or destructive get for each of a msg in the queue. |
|
Back to top |
|
 |
shashivarungupta |
Posted: Thu Jun 18, 2009 1:57 am Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
Sam Uppu wrote: |
You can also use rfhutil to browse or destructive get for each of a msg in the queue. |
I think, kodiakk is looking for the selective messages in a queue.
as he said ".. remove the first 23 messages.." or suppose he wants to pick the message(s) from the middle of the queue.
MO71 is the better option, i would say. _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 18, 2009 4:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I suspect that kodiakk is actually thinking of ma01, not m071.
or a dead simple script on amqsget/amqsgetc. |
|
Back to top |
|
 |
kodiakk |
Posted: Thu Jun 18, 2009 4:24 am Post subject: |
|
|
Acolyte
Joined: 04 Dec 2007 Posts: 58 Location: Jacksonville, Fl.
|
Yes, you guys are correct. I am looking to selectively remove items from a queue, either 1-23, or 213-279, something like that. At one point, a number of years ago, I am pretty sure that my teamlead presented us with a simple command (or sample application) that allowed a "destructive browse" or a "get" where we could designate a range of messages.
Anyway, the MO71 support pack did do the trick, and I appreciate all of the feedback.
Thanks guys! _________________ "Don't take life too seriously... you won't get out of it alive..." |
|
Back to top |
|
 |
shashivarungupta |
Posted: Thu Jun 18, 2009 4:28 am Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
kodiakk wrote: |
Yes, you guys are correct. I am looking to selectively remove items from a queue, either 1-23, or 213-279, something like that. At one point, a number of years ago, I am pretty sure that my teamlead presented us with a simple command (or sample application) that allowed a "destructive browse" or a "get" where we could designate a range of messages.
Anyway, the MO71 support pack did do the trick, and I appreciate all of the feedback.
Thanks guys! |
Let us know, if you'd come to know about that command/application some how.  _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
aditya.aggarwal |
Posted: Thu Jun 18, 2009 5:31 am Post subject: |
|
|
 Master
Joined: 13 Jan 2009 Posts: 252
|
we are using the MQMON utility to remove the message from nth position.
i think it is MO72 only?
Cheers,
Aditya |
|
Back to top |
|
 |
|