use of org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter in project activemq-artemis by apache.
the class mLevelDBXARecoveryBrokerTest method configureBroker.
@Override
protected void configureBroker(BrokerService broker) throws Exception {
super.configureBroker(broker);
MultiKahaDBPersistenceAdapter mKahaDB = new MultiKahaDBPersistenceAdapter();
List<FilteredKahaDBPersistenceAdapter> adapters = new LinkedList<>();
FilteredKahaDBPersistenceAdapter defaultEntry = new FilteredKahaDBPersistenceAdapter();
defaultEntry.setPersistenceAdapter(new LevelDBPersistenceAdapter());
adapters.add(defaultEntry);
FilteredKahaDBPersistenceAdapter special = new FilteredKahaDBPersistenceAdapter();
special.setDestination(new ActiveMQQueue("special"));
special.setPersistenceAdapter(new LevelDBPersistenceAdapter());
adapters.add(special);
mKahaDB.setFilteredPersistenceAdapters(adapters);
broker.setPersistenceAdapter(mKahaDB);
}
use of org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter in project activemq-artemis by apache.
the class DurableSubscriptionOfflineTestListener method setPersistenceAdapter.
public PersistenceAdapter setPersistenceAdapter(BrokerService broker, PersistenceAdapterChoice choice) throws IOException {
PersistenceAdapter adapter = null;
switch(choice) {
case JDBC:
LOG.debug(">>>> setPersistenceAdapter to JDBC ");
adapter = new JDBCPersistenceAdapter();
break;
case KahaDB:
LOG.debug(">>>> setPersistenceAdapter to KahaDB ");
adapter = new KahaDBPersistenceAdapter();
break;
case LevelDB:
LOG.debug(">>>> setPersistenceAdapter to LevelDB ");
adapter = new LevelDBPersistenceAdapter();
break;
case MEM:
LOG.debug(">>>> setPersistenceAdapter to MEM ");
adapter = new MemoryPersistenceAdapter();
break;
}
broker.setPersistenceAdapter(adapter);
return adapter;
}
use of org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter in project activemq-artemis by apache.
the class CheckDuplicateMessagesOnDuplexTest method persistenceAdapterFactory_LevelDB.
private PersistenceAdapter persistenceAdapterFactory_LevelDB(String path) {
LevelDBPersistenceAdapter levelDBPersistenceAdapter = new LevelDBPersistenceAdapter();
levelDBPersistenceAdapter.setDirectory(new File(path));
return levelDBPersistenceAdapter;
}
use of org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter in project activemq-artemis by apache.
the class TestSupport method setPersistenceAdapter.
public static PersistenceAdapter setPersistenceAdapter(BrokerService broker, PersistenceAdapterChoice choice) throws IOException {
PersistenceAdapter adapter = null;
switch(choice) {
case JDBC:
JDBCPersistenceAdapter jdbcPersistenceAdapter = new JDBCPersistenceAdapter();
// rollback (at shutdown) on derby can take a long time with file io etc
jdbcPersistenceAdapter.setUseLock(false);
adapter = jdbcPersistenceAdapter;
break;
case KahaDB:
adapter = new KahaDBPersistenceAdapter();
break;
case LevelDB:
adapter = new LevelDBPersistenceAdapter();
break;
case MEM:
adapter = new MemoryPersistenceAdapter();
break;
}
broker.setPersistenceAdapter(adapter);
adapter.setDirectory(new File(broker.getBrokerDataDirectory(), choice.name()));
return adapter;
}
Aggregations