// URI(brokerURI));
BrokerService broker = new BrokerService();
broker.setPersistent(false);
// for running on Java 5 without mx4j
ManagementContext managementContext = broker.getManagementContext();
managementContext.setFindTigerMbeanServer(true);
managementContext.setUseMBeanServer(true);
managementContext.setCreateConnector(false);
broker.setUseJmx(true);
// broker.setPlugins(new BrokerPlugin[] { new
// ConnectionDotFilePlugin(), new UDPTraceBrokerPlugin() });
broker.addConnector("tcp://localhost:61616");