| Author | Message | 
		
		  | pcouas | 
			  
				|  Posted: Thu Sep 12, 2019 8:22 pm    Post subject: |   |  | 
		
		  | Voyager
 
 
 Joined: 06 Sep 2011Posts: 79
 
 
 | 
			  
				| Hi 
 " why not simply you amqsget / RFHUtil / A.N.Other utility to destructively read all the messages off? Why so desparate to use CLEAR QUEUE?"
 This  "amqsget / RFHUtil " could be coded in Java with PCF Commands ?
 
 Regards
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Fri Sep 13, 2019 4:09 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| pcouas wrote: |  
	| This  "amqsget / RFHUtil " could be coded in Java with PCF Commands ? |  
 
   
 These utilities would simply read the queue until it's empty.
 
 So if you want to write a piece of Java that reads the queue until it's empty, go for it.
 
 The point that I and others are making is that this is a commonly used way of clearing a queue with an open handle on it and there are utilities available to assist if you choose to use them. If you instead choose to roll your own, go for it.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Andyh | 
			  
				|  Posted: Sun Sep 15, 2019 10:06 pm    Post subject: |   |  | 
		
		  | Master
 
 
 Joined: 29 Jul 2010Posts: 239
 
 
 | 
			  
				| It wasn't 100% clear to me from the initial post whether the amqrmppa was acting on behalf of a message channel, or a client channel. Assuming the former, a receiver channel will keep a cache of queue handles open to avoid the overheads associated with opening the queue each time a message is sent down the channel.
 If the handle hasn't been used recently then it should be pruned automatically, while if messages are still arriving over the channel you'd need to stop the channel to close the handle.
 Using a repeating MQGET doesn't carry the same guarantees as CLEAR QL, for example a message which is locked to a UOW or a browse cursor would be invisible to an MQGET.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | gbaddeley | 
			  
				|  Posted: Mon Sep 16, 2019 4:34 pm    Post subject: |   |  | 
		
		  |  Jedi Knight
 
 
 Joined: 25 Mar 2003Posts: 2538
 Location: Melbourne, Australia
 
 | 
			  
				| As an aside, app messaging designs using MQ should not have any requirement to "clear queues" or "drain queues". There should be a well-behaved consumer app, or otherwise the messages should not be produced in the first place. 
 We have hundreds of MQ messaging interfaces using many different producer and consumer app technologies (including Java MQ classes, JMS, IIB, .Net), and we never need to clear any queues under normal operations.
 _________________
 Glenn
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | sderiis | 
			  
				|  Posted: Wed Oct 02, 2019 1:24 pm    Post subject: |   |  | 
		
		  | Newbie
 
 
 Joined: 02 Oct 2019Posts: 3
 
 
 | 
			  
				| Ok But This channel could block CLEAR QUEUE operation and giving an 4004 Error ?
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | bruce2359 | 
			  
				|  Posted: Wed Oct 02, 2019 2:22 pm    Post subject: |   |  | 
		
		  |  Poobah
 
 
 Joined: 05 Jan 2008Posts: 9486
 Location: US: west coast, almost. Otherwise, enroute.
 
 | 
			  
				| ... and in any case, when I'm asked to clear any prod queue, I get a signed waiver from mgt. relieving me of any downstream responsibility for loss of data. _________________
 I like deadlines. I like to wave as they pass by.
 ב''ה
 Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | HubertKleinmanns | 
			  
				|  Posted: Mon Oct 07, 2019 12:03 am    Post subject: |   |  | 
		
		  |  Shaman
 
 
 Joined: 24 Feb 2004Posts: 732
 Location: Germany
 
 | 
			  
				| 
   
	| sderiis wrote: |  
	| Ok But This channel could block CLEAR QUEUE operation and giving an 4004 Error ?
 |  
 Any application, which has a handle on a queue, blocks CLEAR QLOCAL.
 
 This could be
 
 - a channel
 
 - the DLQ handler
 
 - other application
 _________________
 Regards
 Hubert
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | PaulClarke | 
			  
				|  Posted: Mon Oct 07, 2019 10:44 am    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 17 Nov 2005Posts: 1002
 Location: New Zealand
 
 | 
			  
				| If you are trying to use MO71 to clear a queue and you can't because someone has the queue open then you can use the good old fashioned way of getting every message off the queue. In the message browse window just right click and then select 'Apply to all messages'. Your Delete button will change to 'Delete All'. Pressing that will now delete all messages from the queue. 
 Cheers,
 
 Paul.
 _________________
 Paul Clarke
 MQGem Software
 www.mqgem.com
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |