From 5bb32abe03bfe22a4179cae02b023afc5fcdc75e Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Thu, 30 Nov 2006 07:19:19 +0000 Subject: [PATCH] https://issues.apache.org/activemq/browse/AMQ-1078 git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/branches/activemq-4.1@480862 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/ActiveMQSessionExecutor.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java index 88b6817c3f..7f298b1f34 100755 --- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java +++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java @@ -63,8 +63,11 @@ public class ActiveMQSessionExecutor implements Task { public void wakeup() { if( !dispatchedBySessionPool ) { - if( taskRunner!=null ) { + if( session.isSessionAsyncDispatch() ) { try { + if( taskRunner == null ) { + taskRunner = session.connection.getSessionTaskRunner().createTaskRunner(this, "ActiveMQ Session: "+session.getSessionId()); + } taskRunner.wakeup(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); @@ -101,10 +104,8 @@ public class ActiveMQSessionExecutor implements Task { synchronized void start() { if( !messageQueue.isRunning() ) { messageQueue.start(); - if( session.isSessionAsyncDispatch() || dispatchedBySessionPool ) { - taskRunner = session.connection.getSessionTaskRunner().createTaskRunner(this, "ActiveMQ Session: "+session.getSessionId()); - } - wakeup(); + if( hasUncomsumedMessages() ) + wakeup(); } }