【发布时间】:2011-09-25 04:48:08
【问题描述】:
我正在创建一个嵌入式 activemq 实例,以便测试通过 JMX 创建/删除主题。 代码看起来有点像下面。 broker.connectorPort 是我尝试设置 JMX 端口,但它不起作用。
String connectString="vm://localhost?broker.persistence=false&broker.useJmx=true&broker.connectorPort=2011"
ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory();
activeMQConnectionFactory.setBrokerURL(connectString);
ActiveMQConnection activeMQConnection = (ActiveMQConnection) activeMQConnectionFactory.createConnection();
activeMQConnection.start();
使用 activemq.xml 进行配置时,以下 xml 有效。我不确定如何将其翻译为 brokerURL。
<managementContext>
<managementContext connectorPort="2011" createConnector="true"/>
</managementContext>
【问题讨论】: