JMXを介してトピックの作成/削除をテストするために、組み込みのactivemqインスタンスを作成しています。コードは次のようになります。ブローカー.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>