通过JMX访问Apache ActiveMQ会抛出Exception Broker Not Found 5.10 [英] Accessing Apache ActiveMQ via JMX throws Exception Broker Not Found 5.10

查看:105
本文介绍了通过JMX访问Apache ActiveMQ会抛出Exception Broker Not Found 5.10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用全新的ActiveMQ 5.10.0安装,在队列中有一条称为测试的消息。我还替换了bin / activemq中的ACTIVEMQ_SUNJMX行以启用JMX:

I'm using a fresh ActiveMQ 5.10.0 installation, where I have a message in a queue called 'testing'. I also replaced the ACTIVEMQ_SUNJMX line in bin/activemq to enable JMX:

ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

JMXServiceURL url1 = new 
JMXServiceURL("service:jmx:rmi:///jndi/rmi://10.222.222.222:1099/jmxrmi");
    JMXConnector jmxc = JMXConnectorFactory.connect(url1);
    MBeanServerConnection conn = jmxc.getMBeanServerConnection( );
    ObjectName activeMQ = new 
 ObjectName("org.apache.activemq:type=Broker,BrokerName=TOM");

    System.out.println(newProxyInstance(conn, activeMQ, BrokerViewMBean.class, true).toString( ));
    Set<ObjectName> brokers = conn.queryNames(activeMQ, null);
                      if (brokers.size() == 0) {
                                    throw new IOException("No broker could be found in the JMX.");
                         }

抛出的异常是

Exception in thread "main" java.io.IOException: No broker could be found in 
the JMX.

类似于通过JMX访问Apache ActiveMQ会抛出异常,但没有帮助。有想法吗?

Similar to Accessing Apache ActiveMQ via JMX throws Exception but did not help. Any ideas?

推荐答案

您需要连接到activemq的jmx。
在CLI中,键入jconsole或转到您的JDK bin路径并从命令行运行jconsole。
您将看到此界面。连接到您的jmx。
精确地转到此处并查看您的对象。
完全复制到您的对象名称中。任何!差额,您将不会得到经纪人。

You need to connect to activemq's jmx . In CLI type jconsole or go to your JDK bin path and run jconsole from command line. You will see this interface. Connect to your jmx. Go here exactly and look at your object. Copy exactly into your object name. Any! difference and you will not get your broker.

这篇关于通过JMX访问Apache ActiveMQ会抛出Exception Broker Not Found 5.10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆