Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
5.10.0
-
None
Description
Upgrading from a 5.5.1 broker to 5.10.
I've managed to work around the issue by making some changes to org.apache.activemq.web.LocalBrokerFacade, but unsure if this is the root issue or a band-aid fix.
Set destinations = getManagedBroker().getQueueRegion().getDestinations(destination);
returns a AuthorizationDestinationFilter when the code is expecting a org.apache.activemq.broker.region.Queue - calling getNext() on the AuthorizationDestinationFilter returns the expected Queue.
Old code:
public void purgeQueue(ActiveMQDestination destination) throws Exception { Set destinations = getManagedBroker().getQueueRegion().getDestinations(destination); for (Iterator i = destinations.iterator(); i.hasNext();) { Destination dest = (Destination) i.next(); if (dest instanceof Queue) { Queue regionQueue = (Queue) dest; regionQueue.purge(); } } }
new:
public void purgeQueue(ActiveMQDestination destination) throws Exception { Set destinations = getManagedBroker().getQueueRegion().getDestinations(destination); for (Iterator i = destinations.iterator(); i.hasNext();) { Destination dest = (Destination) i.next(); if (dest instanceof Queue) { Queue regionQueue = (Queue) dest; regionQueue.purge(); } else if(dest instanceof AuthorizationDestinationFilter) { AuthorizationDestinationFilter adf = (AuthorizationDestinationFilter)dest; if (adf.getNext() instanceof Queue) { Queue regionQueue = (Queue)adf.getNext(); regionQueue.purge(); } } } }
Attached is the activemq.xml file we're using to test this - creating a message on the webconsole and then attempting to purge it will fail unless either the code change above is made, or the <plugins> section of activemq.xml is commented out.
Attachments
Attachments
Issue Links
- is duplicated by
-
AMQ-5685 Purge does not work when simple authorisation plugin is used
- Resolved