0
我正在使用新鮮的ActiveMQ 5.10.0安裝,其中有一個名爲'testing'的隊列中有消息。我也換成了ACTIVEMQ_SUNJMX線斌/ ActiveMQ的啓用JMX:通過JMX訪問Apache ActiveMQ拋出異常代理未找到5.10
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.
到Accessing Apache ActiveMQ via JMX throws Exception類似,但沒有幫助。有任何想法嗎?
所以我可以 org.apache.activemq:type = Broker,BrokerName = TOM,connector = clientC onnectors,connectorName = openwire for consumer? – Sein3i8