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 » how to clear a queue regularly

Post new topic  Reply to topic
 how to clear a queue regularly « View previous topic :: View next topic » 
Author Message
mrlazy
PostPosted: Fri Aug 11, 2006 7:35 am    Post subject: how to clear a queue regularly Reply with quote

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

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
View user's profile Send private message
mrlazy
PostPosted: Fri Aug 11, 2006 8:12 am    Post subject: Reply with quote

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
View user's profile Send private message
tkane
PostPosted: Fri Aug 11, 2006 8:40 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Fri Aug 11, 2006 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
vennela
PostPosted: Fri Aug 11, 2006 9:33 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

use the support pac "Q Program"
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mrlazy
PostPosted: Fri Aug 11, 2006 9:41 am    Post subject: Reply with quote

Centurion

Joined: 19 Apr 2006
Posts: 144

Thanks for your replies
Back to top
View user's profile Send private message
csmith28
PostPosted: Fri Aug 11, 2006 2:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Fri Aug 11, 2006 6:51 pm    Post subject: Re: how to clear a queue regularly Reply with quote

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
View user's profile Send private message
tleichen
PostPosted: Mon Aug 14, 2006 11:08 am    Post subject: Re: how to clear a queue regularly Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » how to clear a queue regularly
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.