use of org.apache.activemq.leveldb.LevelDBStore in project activemq-artemis by apache.
the class DurableSubProcessWithRestartTest method startBroker.
private void startBroker(boolean deleteAllMessages) throws Exception {
if (broker != null)
return;
broker = BrokerFactory.createBroker("broker:(vm://" + getName() + ")");
broker.setBrokerName(getName());
broker.setAdvisorySupport(false);
broker.setDeleteAllMessagesOnStartup(deleteAllMessages);
switch(PERSISTENT_ADAPTER) {
case MEMORY:
broker.setPersistent(false);
break;
case LEVELDB:
File datadir = new File("activemq-data/" + getName() + "-leveldb");
if (deleteAllMessages)
delete(datadir);
broker.setPersistent(true);
LevelDBStore amq = new LevelDBStore();
amq.setDirectory(datadir);
broker.setPersistenceAdapter(amq);
break;
case KAHADB:
File kahadbData = new File("activemq-data/" + getName() + "-kahadb");
if (deleteAllMessages)
delete(kahadbData);
broker.setPersistent(true);
KahaDBPersistenceAdapter kahadb = new KahaDBPersistenceAdapter();
kahadb.setDirectory(kahadbData);
kahadb.setJournalMaxFileLength(5 * 1024 * 1024);
broker.setPersistenceAdapter(kahadb);
break;
}
broker.addConnector("tcp://localhost:61656");
broker.getSystemUsage().getMemoryUsage().setLimit(256 * 1024 * 1024);
broker.getSystemUsage().getTempUsage().setLimit(256 * 1024 * 1024);
broker.getSystemUsage().getStoreUsage().setLimit(256 * 1024 * 1024);
broker.start();
}
use of org.apache.activemq.leveldb.LevelDBStore in project activemq-artemis by apache.
the class QueueBrowsingLevelDBTest method createBroker.
@Override
public BrokerService createBroker() throws IOException {
BrokerService broker = super.createBroker();
LevelDBStore store = new LevelDBStore();
store.setDirectory(new File("target/test-data/leveldb"));
broker.setPersistenceAdapter(store);
return broker;
}
Aggregations