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 » Queue Cleanup in MQ installed in Windows Server

Post new topic  Reply to topic
 Queue Cleanup in MQ installed in Windows Server « View previous topic :: View next topic » 
Author Message
pandeg
PostPosted: Thu Aug 18, 2016 7:44 am    Post subject: Queue Cleanup in MQ installed in Windows Server Reply with quote

Disciple

Joined: 21 Oct 2014
Posts: 195

Hi, We have a MQ installed in windows Server. To empty the queue which option is efficient in MQ explorer

1. Using a Queue Clear command
2. Using a MQGET API calls.

Please suggest.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 18, 2016 7:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The one that works is the most efficient.

Using MQ Explorer is not efficient.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Aug 18, 2016 8:21 am    Post subject: Re: Queue Cleanup in MQ installed in Windows Server Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

pandeg wrote:
Hi, We have a MQ installed in windows Server. To empty the queue which option is efficient in MQ explorer


The most efficient way to clear a queue is to have the application read it until it's empty. Or have the messages expire.

If you want to clear a queue because it's full of test messages in a non-prod environment then you do it so infrequently the efficiency doesn't really matter.

mqjeff wrote:
Using MQ Explorer is not efficient




Any of the support pacs will outperform it
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Aug 18, 2016 8:45 am    Post subject: Re: Queue Cleanup in MQ installed in Windows Server Reply with quote

Jedi Council

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

Vitor wrote:


The most efficient way to clear a queue is to have the application read it until it's empty. Or have the messages expire.




It is a pity that windows does not have an equivalent of /dev/null
If it did, you could read all the messages and direct the output to the null device. nice and clean.

I have a version of amqsget modified to just read every message from the specificed queue and have a read timeout of 1 second. No output is made unless there is an error.
Comes in very useful when testing large volumes of messages.
_________________
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: Thu Aug 18, 2016 9:05 am    Post subject: Reply with quote

Jedi Knight

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

mqjeff wrote:
Using MQ Explorer is not efficient.

True. In MQ Visual Edit and MQ Batch Toolkit, they both have a 'Clear Queue' function. The code first checks the queue's IPPROCS & OPPROCS attributes, if both are zero then it issues a PCF CLEARQ command otherwise, the code will destructively get every message on the queue. The destructive get is issued for 1 byte to keep the network traffic low and keep the deletion speed very high.

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
tczielke
PostPosted: Thu Aug 18, 2016 12:39 pm    Post subject: Re: Queue Cleanup in MQ installed in Windows Server Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

smdavies99 wrote:
Vitor wrote:


The most efficient way to clear a queue is to have the application read it until it's empty. Or have the messages expire.




It is a pity that windows does not have an equivalent of /dev/null
If it did, you could read all the messages and direct the output to the null device. nice and clean.

I have a version of amqsget modified to just read every message from the specificed queue and have a read timeout of 1 second. No output is made unless there is an error.
Comes in very useful when testing large volumes of messages.


For Unix where you can do:

amqsget Q1 > /dev/null

the equivalent on Windows would be:

amqsget Q1 >NUL
_________________
Working with MQ since 2010.
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 » Queue Cleanup in MQ installed in Windows Server
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.