use of org.apache.activemq.broker.BrokerService in project spring-framework by spring-projects.
the class StompBrokerRelayMessageHandlerIntegrationTests method startActiveMqBroker.
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();
}
use of org.apache.activemq.broker.BrokerService in project camel by apache.
the class MQTTDuplicatesTest method testMqttDuplicatesAfterBrokerRestartWithoutClientID.
@Test
public void testMqttDuplicatesAfterBrokerRestartWithoutClientID() throws Exception {
brokerService.stop();
brokerService.waitUntilStopped();
LOG.info(">>>>>>>>>> Restarting broker...");
brokerService = new BrokerService();
brokerService.setPersistent(false);
brokerService.setAdvisorySupport(false);
brokerService.addConnector(MQTTTestSupport.getConnection() + "?trace=true");
brokerService.start();
brokerService.waitUntilStarted();
LOG.info(">>>>>>>>>> Broker restarted");
for (int i = 0; i < MESSAGE_COUNT; i++) {
String body = System.currentTimeMillis() + ": Dummy-restart-without-clientID! " + i;
templateWithoutClientID.asyncSendBody("direct:withoutClientID", body);
Thread.sleep(WAIT_MILLIS);
}
assertNoDuplicates();
}
use of org.apache.activemq.broker.BrokerService in project camel by apache.
the class PahoComponentTest method doPreSetup.
@Override
public void doPreSetup() throws Exception {
super.doPreSetup();
broker = new BrokerService();
broker.setPersistent(false);
broker.addConnector("mqtt://localhost:" + mqttPort);
broker.start();
}
use of org.apache.activemq.broker.BrokerService in project camel by apache.
the class JmsTestSupport method doPreSetup.
/**
* Set up the Broker
*
* @see org.apache.camel.test.junit4.CamelTestSupport#doPreSetup()
*
* @throws Exception
*/
@Override
protected void doPreSetup() throws Exception {
deleteDirectory("target/activemq-data");
broker = new BrokerService();
int port = AvailablePortFinder.getNextAvailable(33333);
brokerUri = "tcp://localhost:" + port;
broker.getManagementContext().setConnectorPort(AvailablePortFinder.getNextAvailable(port + 1));
configureBroker(broker);
startBroker();
}
use of org.apache.activemq.broker.BrokerService in project camel by apache.
the class SjmsConnectionTestSupport method createBroker.
protected void createBroker() throws Exception {
String connectString = getConnectionUri();
if (ObjectHelper.isEmpty(connectString)) {
connectString = TCP_BROKER_CONNECT_STRING;
}
brokerService = new BrokerService();
brokerService.setPersistent(isPersistenceEnabled());
brokerService.addConnector(connectString);
brokerService.start();
brokerService.waitUntilStarted();
}
Aggregations