コード例 #1
0
  protected BrokerService createBroker(int brokerid, boolean addToNetwork) throws Exception {
    BrokerService broker = super.createBroker(brokerid, addToNetwork);

    LevelDBStore levelDBStore = new LevelDBStore();
    levelDBStore.setDirectory(new File(broker.getBrokerDataDirectory(), "levelDB"));
    broker.setPersistenceAdapter(levelDBStore);
    return broker;
  }
 @Override
 protected PersistenceAdapter createStore(boolean delete) throws IOException {
   LevelDBStore store = new LevelDBStore();
   store.setLogSize(maxFileLength);
   if (delete) {
     store.deleteAllMessages();
   }
   return store;
 }