[jira] [Resolved] (AMQ-5252) Purge through webconsole fails if authorizationPlugin is used

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (AMQ-5252) Purge through webconsole fails if authorizationPlugin is used

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/AMQ-5252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish resolved AMQ-5252.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 5.12.0

Fix by patch in AMQ-5685

> 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
>             Fix For: 5.12.0
>
>         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 <plugins> section of activemq.xml is commented out.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)