//broker.setDeleteAllMessagesOnStartup(true);
broker.setPersistent(true);
broker.setUseJmx(true);
if (useAMQPStore) {
AMQPersistenceAdapterFactory factory = (AMQPersistenceAdapterFactory) broker
.getPersistenceFactory();
// ensure there are a bunch of data files but multiple entries in
// each
// factory.setMaxFileLength(1024 * 20);
// speed up the test case, checkpoint an cleanup early and often
// factory.setCheckpointInterval(500);
factory.setCleanupInterval(1000 * 60 * 30);
factory.setSyncOnWrite(false);
// int indexBinSize=262144; // good for 6M
int indexBinSize = 1024;
factory.setIndexMaxBinSize(indexBinSize * 2);
factory.setIndexBinSize(indexBinSize);
factory.setIndexPageSize(192 * 20);
} else {
KahaDBStore kaha = new KahaDBStore();
kaha.setDirectory(new File("target/activemq-data/kahadb"));
// The setEnableJournalDiskSyncs(false) setting is a little dangerous right now, as I have not verified
// what happens if the index is updated but a journal update is lost.