Author |
Message
|
pandeg |
Posted: Thu Aug 18, 2016 7:44 am Post subject: Queue Cleanup in MQ installed in Windows Server |
|
|
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 |
|
 |
mqjeff |
Posted: Thu Aug 18, 2016 7:47 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Thu Aug 18, 2016 8:21 am Post subject: Re: Queue Cleanup in MQ installed in Windows Server |
|
|
 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 |
|
 |
smdavies99 |
Posted: Thu Aug 18, 2016 8:45 am Post subject: Re: Queue Cleanup in MQ installed in Windows Server |
|
|
 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 |
|
 |
RogerLacroix |
Posted: Thu Aug 18, 2016 9:05 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 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 |
|
 |
tczielke |
Posted: Thu Aug 18, 2016 12:39 pm Post subject: Re: Queue Cleanup in MQ installed in Windows Server |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 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 |
|
 |
|