use of org.apache.activemq.leveldb.LevelDBStore in project activemq-artemis by apache.
the class LevelDBDurableTopicTest method configureBroker.
/*
* protected BrokerService createBroker() throws Exception{ Resource
* resource=new ClassPathResource(
* "org/apache/activemq/perf/kahaBroker.xml"); BrokerFactoryBean factory=new
* BrokerFactoryBean(resource); factory.afterPropertiesSet(); BrokerService
* result=factory.getBroker(); result.start(); return result; }
*/
@Override
protected void configureBroker(BrokerService answer, String uri) throws Exception {
LevelDBStore store = new LevelDBStore();
answer.setPersistenceAdapter(store);
answer.setDeleteAllMessagesOnStartup(true);
answer.addConnector(uri);
}
use of org.apache.activemq.leveldb.LevelDBStore in project activemq-artemis by apache.
the class LevelDBStoreQueueTest method configureBroker.
@Override
protected void configureBroker(BrokerService answer, String uri) throws Exception {
File dataFileDir = new File("target/test-amq-data/perfTest/amq");
LevelDBStore adaptor = new LevelDBStore();
adaptor.setDirectory(dataFileDir);
answer.setPersistenceAdapter(adaptor);
answer.addConnector(uri);
answer.setDeleteAllMessagesOnStartup(true);
}
use of org.apache.activemq.leveldb.LevelDBStore in project activemq-artemis by apache.
the class SingleBrokerVirtualDestinationsWithWildcardLevelDBTest method configurePersistenceAdapter.
@Override
protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
File dataFileDir = new File("target/test-amq-data/leveldb/" + broker.getBrokerName());
LevelDBStore kaha = new LevelDBStore();
kaha.setDirectory(dataFileDir);
broker.setPersistenceAdapter(kaha);
}
use of org.apache.activemq.leveldb.LevelDBStore in project activemq-artemis by apache.
the class DurableSubProcessConcurrentCommitActivateNoDuplicateTest 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 amqData = new File("activemq-data/" + getName() + "-leveldb");
if (deleteAllMessages)
delete(amqData);
broker.setPersistent(true);
LevelDBStore amq = new LevelDBStore();
amq.setDirectory(amqData);
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(1024 * 1024 * 1024);
PolicyMap policyMap = new PolicyMap();
PolicyEntry defaultEntry = new PolicyEntry();
defaultEntry.setMaxAuditDepth(20000);
policyMap.setDefaultEntry(defaultEntry);
broker.setDestinationPolicy(policyMap);
broker.start();
}
use of org.apache.activemq.leveldb.LevelDBStore in project activemq-artemis by apache.
the class ManagedDurableSubscriptionTest method startBroker.
private void startBroker() throws Exception {
broker = BrokerFactory.createBroker("broker:(vm://localhost)");
broker.setKeepDurableSubsActive(false);
broker.setPersistent(true);
LevelDBStore persistenceAdapter = new LevelDBStore();
persistenceAdapter.setDirectory(new File("activemq-data/" + getName()));
broker.setPersistenceAdapter(persistenceAdapter);
broker.setUseJmx(true);
broker.getManagementContext().setCreateConnector(false);
broker.setBrokerName(getName());
broker.start();
connection = createConnection();
}
Aggregations