【问题标题】:Monitoring the activemq queue with Jolokia使用 Jolokia 监控 activemq 队列
【发布时间】:2018-01-30 14:24:04
【问题描述】:

使用 activemq jms 队列机制,我想监控我的队列,例如队列的大小。我使用 Jolokia 作为在 JMX 上执行休息请求的桥梁。

在 wildfly 中配置了队列并且工作正常:

<subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
        <server name="default">
            <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
                ...
            </http-connector>
            <http-acceptor name="http-acceptor" http-listener="default"/>
                ...
            </http-acceptor>
            <jms-queue name="QueueName" entries="java:/jms/queue/QueueName"/>
            <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
        </server>
</subsystem>

我已经在 wildfly 下部署了 Jolokia 战争文件,下面的 url 给我带来了一个属性列表:

   localhost:8080/jolokia/list 

现在我想阅读有关我的队列的信息,所以我使用以下休息请求:

   localhost:8080/jolokia/read/org.apache.activemq.artemis:module=JMS,type=Queue,name=*QueueName*

但是,这会引发以下异常:

  "stacktrace": "javax.management.InstanceNotFoundException: No MBean with pattern org.apache.activemq.artemis:module=JMS,type=Queue,name=*QueueName* found for reading attributes\n\tat org.jolokia.handler.ReadHandler.searchMBeans(ReadHandler.java:160)\n\tat org.jolokia.handler.ReadHandler.fetchAttributesForMBeanPattern(ReadHandler.java:126)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:116)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:37)\n\tat org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:161)\n\tat org.jolokia.backend.MBeanServerHandler

我尝试通过添加 jmx 子系统来独立启用 jmx,如下所示:

<subsystem xmlns="urn:jboss:domain:jmx:1.3">
        <remoting-connector use-management-endpoint="false"/>
</subsystem>


 <connector socket-binding="jmx-remote" name="jmx-remote-connector" security-    realm="ApplicationRealm"/>


 <socket-binding name="jmx-remote" port="${jboss.jmx.port:7909}" fixed-port="false"/>

但它仍然不起作用。任何有关我的方法或替代方法的更正的帮助将不胜感激。

【问题讨论】:

    标签: wildfly jmx activemq-artemis jolokia


    【解决方案1】:

    如果*QueueName* 包含/,则需要转义 使用!/。例如,jms/inputq 必须转换为 jms!/inputq

    如果您想避免转义,可以使用查询参数q。然后该网址最终看起来像/jolokia?p=/read/...

    有关转义的更多信息,请参阅https://jolokia.org/reference/html/protocol.html

    【讨论】:

      猜你喜欢
      • 2018-10-29
      • 2014-11-03
      • 2016-11-09
      • 1970-01-01
      • 2011-12-27
      • 1970-01-01
      • 1970-01-01
      • 2013-10-25
      • 1970-01-01
      相关资源
      最近更新 更多