英文:
Not getting active consumers list in ActiveMQ
问题
我已安装了ActiveMQ版本5.16.5,但当我尝试点击队列名称来检查活动消费者列表时,我没有看到任何消费者。然而,在仪表板上显示队列有16个消费者。
我是否漏掉了activemq.xml或其他文件中的任何配置?我希望显示所有消费者,与图片1中显示的数字相符。
英文:
I have installed ActiveMQ version 5.16.5, but when I try to check active consumers list by clicking on queue name I am not getting any consumers. However, in dashboard it shows queue has 16 consumers.
displays number of active consumers - 16:
displays no active consumers for same queue:
Is there any configuration I am missing into activemq.xml or any other file? I'm expecting to display all consumers from the numbers shown in pic1.
答案1
得分: 1
My ActiveMQ version is 5.16.6
I have resolved it. I find the root cause. In org.apache.activemq.web.BrokerFacadeSupport
@Override
@SuppressWarnings("unchecked")
public Collection<SubscriptionViewMBean> 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,*");
Set<ObjectName> queryResult = queryNames(query, null);
return getManagedObjects(queryResult.toArray(new ObjectName[queryResult.size()]), SubscriptionViewMBean.class);
}
These quotes are redundant. When I delete these quotes and replace this class file in activemq-web-5.16.6.jar and restart ActiveMQ, the consumer list appears.
英文:
My ActiveMQ version is 5.16.6
I have resolved it . I find the root cause. In org.apache.activemq.web.BrokerFacadeSupport
@Override
@SuppressWarnings("unchecked")
public Collection<SubscriptionViewMBean> 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,*");
Set<ObjectName> queryResult = queryNames(query, null);
return getManagedObjects(queryResult.toArray(new ObjectName[queryResult.size()]), SubscriptionViewMBean.class);
}
these quotes are redundant,when i delete these quotes,and replace this class file to activemq-web-5.16.6.jar and restart active mq . the the consumer list appears.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论