Java Code Examples for org.apache.activemq.artemis.core.config.Configuration#setPagingDirectory()

The following examples show how to use org.apache.activemq.artemis.core.config.Configuration#setPagingDirectory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DBOption.java    From activemq-artemis with Apache License 2.0 6 votes vote down vote up
public Configuration getParameterConfiguration() throws Exception {
   Configuration configuration = readConfiguration();
   if (isJDBC()) {
      DatabaseStorageConfiguration storageConfiguration = new DatabaseStorageConfiguration();
      storageConfiguration.setJdbcConnectionUrl(getJdbcURL());
      storageConfiguration.setJdbcDriverClassName(getJdbcClassName());
      storageConfiguration.setBindingsTableName(getJdbcBindings());
      storageConfiguration.setMessageTableName(getJdbcMessages());
      storageConfiguration.setLargeMessageTableName(getJdbcLargeMessages());
      storageConfiguration.setPageStoreTableName(getJdbcPageStore());
      storageConfiguration.setNodeManagerStoreTableName(getJdbcNodeManager());
      configuration.setStoreConfiguration(storageConfiguration);
   } else {
      configuration.setBindingsDirectory(getBinding());
      configuration.setJournalDirectory(getJournal());
      configuration.setPagingDirectory(getPaging());
      configuration.setLargeMessagesDirectory(getLargeMessages());
      configuration.setJournalType(JournalType.NIO);
   }

   return configuration;
}
 
Example 2
Source File: RelativePathTest.java    From activemq-artemis with Apache License 2.0 6 votes vote down vote up
@Test
public void testRelativePath() throws Exception {
   Configuration configuration = createDefaultConfig(false);

   File instanceHome = new File(getTemporaryDir(), "artemisHome");
   File dataHome = new File(instanceHome, "data");
   // One folder up for testing
   File bindingsHome = new File(instanceHome, "../binx");

   instanceHome.mkdirs();
   configuration.setBrokerInstance(instanceHome);

   configuration.setJournalDirectory("./data");
   configuration.setPagingDirectory("./paging");
   configuration.setBindingsDirectory("../binx");
   // one folder up from instance home
   configuration.setLargeMessagesDirectory("./large");

   ActiveMQServer server = createServer(true, configuration, AddressSettings.DEFAULT_PAGE_SIZE, AddressSettings.DEFAULT_MAX_SIZE_BYTES, new HashMap<String, AddressSettings>());

   server.start();
   server.stop();

   checkData(dataHome, ".amq");
   checkData(bindingsHome, ".bindings");
}
 
Example 3
Source File: ColocatedHAManager.java    From activemq-artemis with Apache License 2.0 6 votes vote down vote up
/**
 * update the backups configuration
 *
 * @param backupConfiguration    the configuration to update
 * @param name                   the new name of the backup
 * @param portOffset             the offset for the acceptors and any connectors that need changing
 * @param remoteConnectors       the connectors that don't need off setting, typically remote
 * @param journalDirectory
 * @param bindingsDirectory
 * @param largeMessagesDirectory
 * @param pagingDirectory
 * @param fullServer
 */
private static void updateSharedStoreConfiguration(Configuration backupConfiguration,
                                                   String name,
                                                   int portOffset,
                                                   List<String> remoteConnectors,
                                                   String journalDirectory,
                                                   String bindingsDirectory,
                                                   String largeMessagesDirectory,
                                                   String pagingDirectory,
                                                   boolean fullServer) {
   backupConfiguration.setName(name);
   backupConfiguration.setJournalDirectory(journalDirectory);
   backupConfiguration.setBindingsDirectory(bindingsDirectory);
   backupConfiguration.setLargeMessagesDirectory(largeMessagesDirectory);
   backupConfiguration.setPagingDirectory(pagingDirectory);
   updateAcceptorsAndConnectors(backupConfiguration, portOffset, remoteConnectors, fullServer);
}
 
Example 4
Source File: ColocatedHAManager.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
/**
 * update the backups configuration
 *
 * @param backupConfiguration the configuration to update
 * @param name                the new name of the backup
 * @param portOffset          the offset for the acceptors and any connectors that need changing
 * @param remoteConnectors    the connectors that don't need off setting, typically remote
 */
private static void updateReplicatedConfiguration(Configuration backupConfiguration,
                                                  String name,
                                                  int portOffset,
                                                  List<String> remoteConnectors,
                                                  boolean fullServer) {
   backupConfiguration.setName(name);
   backupConfiguration.setJournalDirectory(backupConfiguration.getJournalDirectory() + name);
   backupConfiguration.setPagingDirectory(backupConfiguration.getPagingDirectory() + name);
   backupConfiguration.setLargeMessagesDirectory(backupConfiguration.getLargeMessagesDirectory() + name);
   backupConfiguration.setBindingsDirectory(backupConfiguration.getBindingsDirectory() + name);
   updateAcceptorsAndConnectors(backupConfiguration, portOffset, remoteConnectors, fullServer);
}