https://issues.apache.org/jira/browse/AMQ-6184 - improve nio transport scalability; get back core pool size

This commit is contained in:
Dejan Bosanac 2016-02-25 13:43:21 +01:00
parent 934a30a327
commit ca5912d9fa
1 changed files with 5 additions and 1 deletions

View File

@ -38,7 +38,7 @@ public final class SelectorManager {
private int maxChannelsPerWorker = 1024; private int maxChannelsPerWorker = 1024;
protected ExecutorService createDefaultExecutor() { protected ExecutorService createDefaultExecutor() {
ThreadPoolExecutor rc = new ThreadPoolExecutor(getDefaultMaximumPoolSize(), getDefaultMaximumPoolSize(), getDefaultKeepAliveTime(), TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), ThreadPoolExecutor rc = new ThreadPoolExecutor(getDefaultCorePoolSize(), getDefaultMaximumPoolSize(), getDefaultKeepAliveTime(), TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
new ThreadFactory() { new ThreadFactory() {
private long i = 0; private long i = 0;
@ -54,6 +54,10 @@ public final class SelectorManager {
return rc; return rc;
} }
private static int getDefaultCorePoolSize() {
return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.corePoolSize", 10);
}
private static int getDefaultMaximumPoolSize() { private static int getDefaultMaximumPoolSize() {
return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.maximumPoolSize", 1024); return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.maximumPoolSize", 1024);
} }