The clearQueue method of (Simple)AMQQueue actually already returns a long 
indicating the number of messages deleted, but the AMQQueueMBean clearQueue() 
method ignores this and just has a void return value. The value is being used 
in the method response message of the QueuePurgeHandler to report the number of 
deleted messages, and presumably that needs to stay the way it is.

Checks for undeleted messages could be made using this number along with the 
before/after MessageCount, but of course general queue activity during the 
process could cause such a check to reach the wrong conclusion. In order to 
accurately report the number of messages not deleted due to being in an 
acquired state a new 'clearQueueAndReportNumAcquired' method would need to be 
added to (Simple)AMQQueue, does that seem ok to everyone? The only real 
alternative is to start using the return value of the existing method in the 
MBean and have the console indicate how many messages were deleted, rather than 
how many were not. Thoughts?

Robbie

> -----Original Message-----
> From: Aidan Skinner (JIRA) 
> Sent: 03 August 2009 16:23 
> 
> The clear queue button prompts but doesn't actually clear the queue. I
> suspect because all the messages have been acquired by consumers. This
> should probably display a better error message if there are acquired
> messages which can't be cleared. An int return of uncleared ones maybe?
> 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to