You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/04/15 00:19:26 UTC
[1/2] activemq-artemis git commit: ARTEMIS-482 Assign dedicated
ThreadPool for InVMTransport
Repository: activemq-artemis
Updated Branches:
refs/heads/master 5678d1ad2 -> 914d93f63
ARTEMIS-482 Assign dedicated ThreadPool for InVMTransport
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/fc8a1eff
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/fc8a1eff
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/fc8a1eff
Branch: refs/heads/master
Commit: fc8a1eff43525a51fef4bc53a23df9f6f9cdaeae
Parents: 5678d1a
Author: Martyn Taylor <mt...@redhat.com>
Authored: Thu Apr 14 12:46:57 2016 +0100
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Thu Apr 14 15:49:07 2016 +0100
----------------------------------------------------------------------
.../core/remoting/impl/invm/InVMConnector.java | 24 ++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fc8a1eff/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
index c1fab77..0783d7c 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
@@ -22,11 +22,17 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
import org.apache.activemq.artemis.core.server.ActiveMQComponent;
-import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.spi.core.remoting.AbstractConnector;
import org.apache.activemq.artemis.spi.core.remoting.Acceptor;
import org.apache.activemq.artemis.spi.core.remoting.BaseConnectionLifeCycleListener;
@@ -86,6 +92,20 @@ public class InVMConnector extends AbstractConnector {
private final Executor closeExecutor;
+ private static ExecutorService threadPoolExecutor;
+
+ private static ExecutorService getInVMExecutor() {
+ if (threadPoolExecutor == null) {
+ if (ActiveMQClient.globalThreadMaxPoolSize <= -1) {
+ threadPoolExecutor = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), Executors.defaultThreadFactory());
+ }
+ else {
+ threadPoolExecutor = Executors.newFixedThreadPool(ActiveMQClient.globalThreadMaxPoolSize);
+ }
+ }
+ return threadPoolExecutor;
+ }
+
public InVMConnector(final Map<String, Object> configuration,
final BufferHandler handler,
final ClientConnectionLifeCycleListener listener,
@@ -101,7 +121,7 @@ public class InVMConnector extends AbstractConnector {
this.closeExecutor = closeExecutor;
- executorFactory = new OrderedExecutorFactory(threadPool);
+ executorFactory = new OrderedExecutorFactory(getInVMExecutor());
InVMRegistry registry = InVMRegistry.instance;
[2/2] activemq-artemis git commit: This closes #462
Posted by cl...@apache.org.
This closes #462
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/914d93f6
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/914d93f6
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/914d93f6
Branch: refs/heads/master
Commit: 914d93f636e9339fa7dbae959cc1bf3cb15bcad2
Parents: 5678d1a fc8a1ef
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Apr 14 18:19:00 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Apr 14 18:19:00 2016 -0400
----------------------------------------------------------------------
.../core/remoting/impl/invm/InVMConnector.java | 24 ++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------