use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class LevelDBStoreBrokerTest method createBroker.
@Override
protected BrokerService createBroker() throws Exception {
BrokerService broker = new BrokerService();
broker.setPersistenceAdapter(createPersistenceAdapter(true));
return broker;
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class LoadTest method createBroker.
/**
* Factory method to create a new broker
*
* @throws Exception
*/
protected BrokerService createBroker(String uri) throws Exception {
BrokerService answer = new BrokerService();
configureBroker(answer, uri);
answer.start();
return answer;
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class BrokerNetworkWithStuckMessagesTest method createRemoteBroker.
protected BrokerService createRemoteBroker() throws Exception {
remoteBroker = new BrokerService();
remoteBroker.setBrokerName("remotehost");
remoteBroker.setUseJmx(true);
remoteBroker.setPersistenceAdapter(null);
remoteBroker.setPersistent(false);
remoteConnector = createRemoteConnector();
remoteBroker.addConnector(remoteConnector);
configureBroker(remoteBroker);
remoteBroker.start();
remoteBroker.waitUntilStarted();
remoteBroker.getManagementContext().setConnectorPort(2222);
brokers.put(remoteBroker.getBrokerName(), remoteBroker);
return remoteBroker;
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class AMQ3410Test method tearDown.
@Override
protected void tearDown() throws Exception {
BrokerService broker = (BrokerService) context.getBean("localbroker");
broker.stop();
broker = (BrokerService) context.getBean("default");
broker.stop();
super.tearDown();
}
use of org.apache.activemq.broker.BrokerService in project activemq-artemis by apache.
the class RedeliveryPluginTest method testInstallPluginValidation.
public void testInstallPluginValidation() throws Exception {
RedeliveryPolicyMap redeliveryPolicyMap = new RedeliveryPolicyMap();
RedeliveryPolicy defaultEntry = new RedeliveryPolicy();
defaultEntry.setInitialRedeliveryDelay(500);
redeliveryPolicyMap.setDefaultEntry(defaultEntry);
underTest.setRedeliveryPolicyMap(redeliveryPolicyMap);
final BrokerService brokerService = new BrokerService();
brokerService.setSchedulerSupport(false);
Broker broker = new ErrorBroker("hi") {
@Override
public BrokerService getBrokerService() {
return brokerService;
}
};
try {
underTest.installPlugin(broker);
fail("expect exception on no scheduler support");
} catch (Exception expected) {
LOG.info("expected: " + expected);
}
brokerService.setSchedulerSupport(true);
try {
underTest.installPlugin(broker);
fail("expect exception on small initial delay");
} catch (Exception expected) {
LOG.info("expected: " + expected);
}
defaultEntry.setInitialRedeliveryDelay(5000);
defaultEntry.setRedeliveryDelay(500);
brokerService.setSchedulerSupport(true);
try {
underTest.installPlugin(broker);
fail("expect exception on small redelivery delay");
} catch (Exception expected) {
LOG.info("expected: " + expected);
}
}
Aggregations