From a562f094f73d9343be95d680b47eb08303d3cc79 Mon Sep 17 00:00:00 2001 From: Yury Gubernatorov Date: Tue, 28 Dec 2021 12:46:24 -0800 Subject: [PATCH] Quote queue names so that web console shows correct results for queue`s producers/subscribers (cherry picked from commit bb375895dee8b6f9dcf89b44c074929c58a854a9) --- .../java/org/apache/activemq/web/BrokerFacadeSupport.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java b/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java index 014dd77265..09e7c9f3dd 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java @@ -240,8 +240,8 @@ public abstract class BrokerFacadeSupport implements BrokerFacade { public Collection getQueueConsumers(String queueName) throws Exception { String brokerName = getBrokerName(); queueName = StringUtils.replace(queueName, "\"", "_"); - ObjectName query = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + brokerName - + ",destinationType=Queue,destinationName=" + queueName + ",endpoint=Consumer,*"); + ObjectName query = new ObjectName("org.apache.activemq:type=Broker,brokerName=\"" + brokerName + + "\",destinationType=Queue,destinationName=\"" + queueName + "\",endpoint=Consumer,*"); Set queryResult = queryNames(query, null); return getManagedObjects(queryResult.toArray(new ObjectName[queryResult.size()]), SubscriptionViewMBean.class); } @@ -251,8 +251,8 @@ public abstract class BrokerFacadeSupport implements BrokerFacade { public Collection getQueueProducers(String queueName) throws Exception { String brokerName = getBrokerName(); queueName = StringUtils.replace(queueName, "\"", "_"); - ObjectName query = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + brokerName - + ",destinationType=Queue,destinationName=" + queueName + ",endpoint=Producer,*"); + ObjectName query = new ObjectName("org.apache.activemq:type=Broker,brokerName=\"" + brokerName + + "\",destinationType=Queue,destinationName=\"" + queueName + "\",endpoint=Producer,*"); Set queryResult = queryNames(query, null); return getManagedObjects(queryResult.toArray(new ObjectName[queryResult.size()]), ProducerViewMBean.class); }