Author |
Message
|
mrlazy |
Posted: Fri Aug 11, 2006 7:35 am Post subject: how to clear a queue regularly |
|
|
Centurion
Joined: 19 Apr 2006 Posts: 144
|
Hi all,
I was trying to find out a way to clear messages on a system queue regularly (WINDOWS), but am not successfull so far. I would greatly appreciate if someone who has a script which clears a queue(which is in use) could share it with me!
Thank you.  |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 11, 2006 7:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
echo "clear ql(%1%)"|runmqsc %2% _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mrlazy |
Posted: Fri Aug 11, 2006 8:12 am Post subject: |
|
|
Centurion
Joined: 19 Apr 2006 Posts: 144
|
Thanks for your quick response.
But since the object is in use, it shows the following error:
AMQ8148: MQSeries object in use.
Now is there a way so that I can force clear on this queue? |
|
Back to top |
|
 |
tkane |
Posted: Fri Aug 11, 2006 8:40 am Post subject: |
|
|
 Voyager
Joined: 23 Dec 2002 Posts: 82 Location: Kansas City
|
It depends how the queue is in use. If you do a display qstatus(queue) type(handle) all you can see who is using it and how. CLEAR QL seems to need exclusive access even to the point where a receiver channel with the queue open for output will stop it from clearing the queue.
We use a program to clear a queue that can be opened for get but that CLEAR QL won't open. Put it into the Windows Task Scheduler and you can clear it if that's what you want to.
My personal favorite program to do this with is C program called mget that came as source in an support pack back in 1996. It's called mget and it has lots of flags to choose how to get messages off the queue.
Good Luck
Tom |
|
Back to top |
|
 |
wschutz |
Posted: Fri Aug 11, 2006 8:50 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
As an aside, the MQ V6 explorer allows you a choice between using CLEARQ and doing MQGETs when you use it to clear a queue... _________________ -wayne |
|
Back to top |
|
 |
vennela |
Posted: Fri Aug 11, 2006 9:33 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
use the support pac "Q Program" |
|
Back to top |
|
 |
mrlazy |
Posted: Fri Aug 11, 2006 9:41 am Post subject: |
|
|
Centurion
Joined: 19 Apr 2006 Posts: 144
|
Thanks for your replies  |
|
Back to top |
|
 |
csmith28 |
Posted: Fri Aug 11, 2006 2:47 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
If the messages are less than 200 bytes you can use the amqsget script in a scheduled task.
Personally I would not do this on a Production MQManager. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Aug 11, 2006 6:51 pm Post subject: Re: how to clear a queue regularly |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
mrlazy wrote: |
Hi all,
I was trying to find out a way to clear messages on a system queue... |
Which System Queue?
Why do you want to clear it regularly? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
tleichen |
Posted: Mon Aug 14, 2006 11:08 am Post subject: Re: how to clear a queue regularly |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
PeterPotkay wrote: |
Which System Queue?
Why do you want to clear it regularly? |
Hopefully it's only something like SYSTEM.ADMIN.CHANNEL.EVENT !!  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
|