Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BBE1B115F2 for ; Mon, 30 Jun 2014 11:11:24 +0000 (UTC) Received: (qmail 97792 invoked by uid 500); 30 Jun 2014 11:11:24 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 97732 invoked by uid 500); 30 Jun 2014 11:11:24 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 97716 invoked by uid 99); 30 Jun 2014 11:11:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2014 11:11:24 +0000 Date: Mon, 30 Jun 2014 11:11:24 +0000 (UTC) From: "Richard Wagg (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMQ-5252) Purge through webconsole fails if authorizationPlugin is used MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-5252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Richard Wagg updated AMQ-5252: ------------------------------ Attachment: activemq.xml > Purge through webconsole fails if authorizationPlugin is used > ------------------------------------------------------------- > > Key: AMQ-5252 > URL: https://issues.apache.org/jira/browse/AMQ-5252 > Project: ActiveMQ > Issue Type: Bug > Components: webconsole > Affects Versions: 5.10.0 > Reporter: Richard Wagg > Priority: Minor > Attachments: activemq.xml > > > 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. > {code} > Set destinations = getManagedBroker().getQueueRegion().getDestinations(destination); > {code} > 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: > {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(); > } > } > } > {code} > new: > {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(); > } > else if(dest instanceof AuthorizationDestinationFilter) > { > AuthorizationDestinationFilter adf = (AuthorizationDestinationFilter)dest; > if (adf.getNext() instanceof Queue) > { > Queue regionQueue = (Queue)adf.getNext(); > regionQueue.purge(); > } > } > } > } > {code} > 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 section of activemq.xml is commented out. -- This message was sent by Atlassian JIRA (v6.2#6252)