/** * Creates and configures a new instance. * * @param dataDirectory root directory where persistent messages are stored * @param useLibAio true to use libaio, false to use NIO. * @param injector Google Guice injector. Used to inject dependency members into commands if needed. * @param queueConfigs vararg of QueueConfig> instances. */ public Async(String dataDirectory, boolean useLibAio, Injector injector, QueueConfig... queueConfigs) { try { this.injector = injector; jmsServer = new EmbeddedJMS(); config = new ConfigurationImpl(); jmsConfig = new JMSConfigurationImpl(); Collections.addAll(queueConfigsList, queueConfigs); configureLocations(dataDirectory); configureAcceptor(); configureConnectionFactory(); configurePaging(); configureQueues(queueConfigs); configureJournal(useLibAio); config.setThreadPoolMaxSize(-1); config.setGracefulShutdownEnabled(true); config.setScheduledThreadPoolMaxSize(10); } catch (AsyncException e) { throw e; } catch (Exception e) { throw new AsyncException("Failed to start EmbeddedJMS", e); } }
/** * Creates and configures a new instance. * * @param dataDirectory root directory where persistent messages are stored * @param useLibAio true to use libaio, false to use NIO. * @param injector Google Guice injector. Used to inject dependency members into commands if needed. * @param queueConfigs vararg of QueueConfig> instances. */ public Async(String dataDirectory, boolean useLibAio, Injector injector, QueueConfig... queueConfigs) { try { this.injector = injector; jmsServer = new EmbeddedJMS(); config = new ConfigurationImpl(); jmsConfig = new JMSConfigurationImpl(); Collections.addAll(queueConfigsList, queueConfigs); configureLocations(dataDirectory); configureAcceptor(); configureConnectionFactory(); configurePaging(); configureQueues(queueConfigs); configureJournal(useLibAio); config.setThreadPoolMaxSize(-1); config.setGracefulShutdownEnabled(true); config.setScheduledThreadPoolMaxSize(10); } catch (AsyncException e) { throw e; } catch (Exception e) { throw new AsyncException("Failed to start EmbeddedJMS", e); } }
config.setThreadPoolMaxSize(getInteger(e, "thread-pool-max-size", config.getThreadPoolMaxSize(), Validators.MINUS_ONE_OR_GT_ZERO));
Map<String, Object> server0Params = new HashMap<>(); ActiveMQServer server0 = createClusteredServerWithParams(isNetty(), 0, true, server0Params); server0.getConfiguration().setThreadPoolMaxSize(10); server1.getConfiguration().setThreadPoolMaxSize(10);
server.getConfiguration().setThreadPoolMaxSize(2); server.start();
configuration.setSecurityInvalidationInterval(SECURITY_INVALIDATION_INTERVAL.resolveModelAttribute(context, model).asLong()); configuration.setServerDumpInterval(SERVER_DUMP_INTERVAL.resolveModelAttribute(context, model).asLong()); configuration.setThreadPoolMaxSize(THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, model).asInt()); configuration.setTransactionTimeout(TRANSACTION_TIMEOUT.resolveModelAttribute(context, model).asLong()); configuration.setTransactionTimeoutScanPeriod(TRANSACTION_TIMEOUT_SCAN_PERIOD.resolveModelAttribute(context, model).asLong());
configuration.setSecurityInvalidationInterval(SECURITY_INVALIDATION_INTERVAL.resolveModelAttribute(context, model).asLong()); configuration.setServerDumpInterval(SERVER_DUMP_INTERVAL.resolveModelAttribute(context, model).asLong()); configuration.setThreadPoolMaxSize(THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, model).asInt()); configuration.setTransactionTimeout(TRANSACTION_TIMEOUT.resolveModelAttribute(context, model).asLong()); configuration.setTransactionTimeoutScanPeriod(TRANSACTION_TIMEOUT_SCAN_PERIOD.resolveModelAttribute(context, model).asLong());
clearDataRecreateServerDirs(); Configuration config = createDefaultInVMConfig().setThreadPoolMaxSize(5).setJournalSyncNonTransactional(false);
conf.setThreadPoolMaxSize(i); Assert.assertEquals(i, conf.getThreadPoolMaxSize());
conf.setThreadPoolMaxSize(i); Assert.assertEquals(i, conf.getThreadPoolMaxSize());