Add some additional control over what is configured on the running

broker.
This commit is contained in:
Timothy Bish 2015-06-12 14:26:04 -04:00
parent 8cc5f597d9
commit d723d14acb
1 changed files with 15 additions and 5 deletions

View File

@ -28,6 +28,8 @@ public class IDERunner {
private static final String AMQP_TRANSFORMER = "jms";
private static final boolean TRANSPORT_TRACE = true;
private static final boolean PERSISTENT = true;
private static final boolean CLIENT_CONNECT = false;
public static void main(String[]args) throws Exception {
BrokerService brokerService = new BrokerService();
@ -40,15 +42,23 @@ public class IDERunner {
KahaDBStore store = new KahaDBStore();
store.setDirectory(new File("target/activemq-data/kahadb"));
brokerService.setStoreOpenWireVersion(10);
brokerService.setPersistenceAdapter(store);
if (PERSISTENT) {
brokerService.setStoreOpenWireVersion(10);
brokerService.setPersistenceAdapter(store);
brokerService.deleteAllMessages();
} else {
brokerService.setPersistent(false);
}
brokerService.setUseJmx(false);
brokerService.deleteAllMessages();
brokerService.setAdvisorySupport(false);
brokerService.start();
Connection connection = JMSClientContext.INSTANCE.createConnection(connector.getPublishableConnectURI());
connection.start();
if (CLIENT_CONNECT) {
Connection connection = JMSClientContext.INSTANCE.createConnection(connector.getPublishableConnectURI());
connection.start();
}
brokerService.waitUntilStopped();
}