From c4f8361d52d1ee1924c0b6959536399b6d0c0a29 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Wed, 15 Mar 2017 10:09:05 -0400 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-6629 Allow for broker stats to be viewed in tests by enabling JMX but disabling the creation of a management connector. --- .../org/apache/activemq/junit/EmbeddedActiveMQBroker.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/activemq-tooling/activemq-junit/src/main/java/org/apache/activemq/junit/EmbeddedActiveMQBroker.java b/activemq-tooling/activemq-junit/src/main/java/org/apache/activemq/junit/EmbeddedActiveMQBroker.java index 3e328e8483..fc0dc190f4 100644 --- a/activemq-tooling/activemq-junit/src/main/java/org/apache/activemq/junit/EmbeddedActiveMQBroker.java +++ b/activemq-tooling/activemq-junit/src/main/java/org/apache/activemq/junit/EmbeddedActiveMQBroker.java @@ -46,13 +46,14 @@ public class EmbeddedActiveMQBroker extends ExternalResource { * * The defaults are: * - the broker name is 'embedded-broker' - * - JMX is disabled + * - JMX is enabled but no management connector will be created. * - Persistence is disabled * */ public EmbeddedActiveMQBroker() { brokerService = new BrokerService(); - brokerService.setUseJmx(false); + brokerService.setUseJmx(true); + brokerService.getManagementContext().setCreateConnector(false); brokerService.setUseShutdownHook(false); brokerService.setPersistent(false); brokerService.setBrokerName("embedded-broker");