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 » Clearing Queues

Post new topic  Reply to topic
 Clearing Queues « View previous topic :: View next topic » 
Author Message
Gideon
PostPosted: Tue Dec 17, 2013 10:29 am    Post subject: Clearing Queues Reply with quote

Chevalier

Joined: 18 Aug 2009
Posts: 403

I have an unusual situation (I use WMQ 7.5)

I have about 8 to 9 QM's that contain about 190 queues.

I need to clear these queues, both in the very near term and repeatedly in the future

Is there any tool or mechanism that would allow the cleearing of all queues within a QM
Back to top
View user's profile Send private message Send e-mail
JosephGramig
PostPosted: Tue Dec 17, 2013 11:07 am    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

Clearly, you would only want to clear certain queues and not all queues.

You could use many Support Pacs to do this. MA0T TestMsg could certainly be used to run a script to read and discard messages. You could even run it from one machine to get them all (assuming you had access).

I would put a lot more thought into what you are saying you want to do...
Back to top
View user's profile Send private message AIM Address
smdavies99
PostPosted: Tue Dec 17, 2013 11:43 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

JosephGramig wrote:


I would put a lot more thought into what you are saying you want to do...


For exmple, If you decide to clear a queue and while that is happening what happens if someone writes and commits a message to that queue during the clear process?

An alternative might be to make the writes set an expiry time on the messages. Then they become pretty well self managing. I do this all the time and it works a treat.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue Dec 17, 2013 2:05 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

Did you try Google?

I have posted to 2 different sample (complete) programs for clearing / emptying a queue:

1. ClearQ is a sample C MQAI code that will issue the clear queue command.
http://www.capitalware.biz/mq_code_c.html

2. EmptyQ is a simple Java program to clear a queue of its messages.
http://www.capitalware.biz/mq_code_java.html

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
SAFraser
PostPosted: Tue Dec 17, 2013 2:44 pm    Post subject: Reply with quote

Shaman

Joined: 22 Oct 2003
Posts: 742
Location: Austin, Texas, USA

For low level development environments where we have no trading partner connections to consume the messages we produce, we routinely create queues with a "depth" trigger that executes a modified version of amqsget.
Back to top
View user's profile Send private message
SAFraser
PostPosted: Tue Dec 17, 2013 2:54 pm    Post subject: Reply with quote

Shaman

Joined: 22 Oct 2003
Posts: 742
Location: Austin, Texas, USA

Oh, and we also have exception and backout messages in low level dev environments, in queues without consumers. We set the DESCR on these queues with a key word, and then we run a shell script via cron that clears matching queues using a modified version of amqsget.

If developers or testers need for such messages to be spared in the weekly purge exercise, we simply change the DESCR in the queue.
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 » Clearing Queues
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.