From ca5912d9fad036a6d9c59e49a3273c5001e0115e Mon Sep 17 00:00:00 2001 From: Dejan Bosanac Date: Thu, 25 Feb 2016 13:43:21 +0100 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-6184 - improve nio transport scalability; get back core pool size --- .../org/apache/activemq/transport/nio/SelectorManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java index bc50003b3f..405a2081be 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorManager.java @@ -38,7 +38,7 @@ public final class SelectorManager { private int maxChannelsPerWorker = 1024; protected ExecutorService createDefaultExecutor() { - ThreadPoolExecutor rc = new ThreadPoolExecutor(getDefaultMaximumPoolSize(), getDefaultMaximumPoolSize(), getDefaultKeepAliveTime(), TimeUnit.SECONDS, new LinkedBlockingQueue(), + ThreadPoolExecutor rc = new ThreadPoolExecutor(getDefaultCorePoolSize(), getDefaultMaximumPoolSize(), getDefaultKeepAliveTime(), TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() { private long i = 0; @@ -54,6 +54,10 @@ public final class SelectorManager { return rc; } + private static int getDefaultCorePoolSize() { + return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.corePoolSize", 10); + } + private static int getDefaultMaximumPoolSize() { return Integer.getInteger("org.apache.activemq.transport.nio.SelectorManager.maximumPoolSize", 1024); }