private void startActiveMqBroker() throws Exception { this.activeMQBroker = new BrokerService(); this.activeMQBroker.addConnector("stomp://localhost:" + this.port); this.activeMQBroker.setStartAsync(false); this.activeMQBroker.setPersistent(false); this.activeMQBroker.setUseJmx(false); this.activeMQBroker.getSystemUsage().getMemoryUsage().setLimit(1024 * 1024 * 5); this.activeMQBroker.getSystemUsage().getTempUsage().setLimit(1024 * 1024 * 5); this.activeMQBroker.start(); }
@Before public void setUp() throws Exception { logger.debug("Setting up before '" + this.testName.getMethodName() + "'"); int port = SocketUtils.findAvailableTcpPort(61613); this.activeMQBroker = new BrokerService(); this.activeMQBroker.addConnector("stomp://127.0.0.1:" + port); this.activeMQBroker.setStartAsync(false); this.activeMQBroker.setPersistent(false); this.activeMQBroker.setUseJmx(false); this.activeMQBroker.getSystemUsage().getMemoryUsage().setLimit(1024 * 1024 * 5); this.activeMQBroker.getSystemUsage().getTempUsage().setLimit(1024 * 1024 * 5); this.activeMQBroker.start(); ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler(); taskScheduler.afterPropertiesSet(); this.client = new ReactorNettyTcpStompClient("127.0.0.1", port); this.client.setMessageConverter(new StringMessageConverter()); this.client.setTaskScheduler(taskScheduler); }
broker.setBrokerContext(brokerContext); broker.setStartAsync(true); broker.start();
@Override public void initialize() { super.initialize(); try { if (_config == null) { _broker = new BrokerService(); _broker.setStartAsync(true); _broker.setBrokerName("default"); _broker.setUseJmx(false); _broker.setPersistent(false); _broker.setDataDirectoryFile(new File(System.getProperty("java.io.tmpdir"), "activemq-data")); _broker.addConnector(ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL); _broker.setUseShutdownHook(false); } else { _broker = BrokerFactory.createBroker(_config); } _broker.start(); } catch (final Exception e) { throw new RuntimeException(e); } }
@Override public void initialize() { super.initialize(); try { if (_config == null) { _broker = new BrokerService(); _broker.setStartAsync(true); _broker.setBrokerName("default"); _broker.setUseJmx(false); _broker.setPersistent(false); _broker.setDataDirectoryFile(new File(System.getProperty("java.io.tmpdir"), "activemq-data")); _broker.addConnector(ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL); _broker.setUseShutdownHook(false); } else { _broker = BrokerFactory.createBroker(_config); } _broker.start(); } catch (final Exception e) { throw new RuntimeException(e); } }
broker.setSystemExitOnShutdown(false); broker.setStartAsync(false);
broker.setSystemExitOnShutdown(false); broker.setStartAsync(false);