未能获取ActiveMQ中的活跃消费者列表。

huangapple go评论61阅读模式
英文:

Not getting active consumers list in ActiveMQ

问题

我已安装了ActiveMQ版本5.16.5,但当我尝试点击队列名称来检查活动消费者列表时,我没有看到任何消费者。然而,在仪表板上显示队列有16个消费者。

显示活动消费者数量 - 16:
未能获取ActiveMQ中的活跃消费者列表。

显示同一队列没有活动消费者:
未能获取ActiveMQ中的活跃消费者列表。

我是否漏掉了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:
未能获取ActiveMQ中的活跃消费者列表。
displays no active consumers for same queue:
未能获取ActiveMQ中的活跃消费者列表。
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

未能获取ActiveMQ中的活跃消费者列表。

I have resolved it . I find the root cause. In org.apache.activemq.web.BrokerFacadeSupport

    @Override
    @SuppressWarnings(&quot;unchecked&quot;)
    public Collection&lt;SubscriptionViewMBean&gt; getQueueConsumers(String queueName) throws Exception {
        String brokerName = getBrokerName();
        queueName = StringUtils.replace(queueName, &quot;\&quot;&quot;, &quot;_&quot;);
        ObjectName query = new ObjectName(&quot;org.apache.activemq:type=Broker,brokerName=\&quot;&quot; + brokerName
                + &quot;\&quot;,destinationType=Queue,destinationName=\&quot;&quot; + queueName + &quot;\&quot;,endpoint=Consumer,*&quot;);
        Set&lt;ObjectName&gt; queryResult = queryNames(query, null);
        return getManagedObjects(queryResult.toArray(new ObjectName[queryResult.size()]), SubscriptionViewMBean.class);
    }

未能获取ActiveMQ中的活跃消费者列表。
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.
未能获取ActiveMQ中的活跃消费者列表。

huangapple
  • 本文由 发表于 2023年6月5日 23:19:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76407859.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定