Author: chirino
Date: Wed Nov 29 13:26:23 2006
New Revision: 480717

URL: http://svn.apache.org/viewvc?view=rev&rev=480717
Log:
Fix for http://issues.apache.org/activemq/browse/AMQ-1078

Modified:
    
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java

Modified: 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java
URL: 
http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java?view=diff&rev=480717&r1=480716&r2=480717
==============================================================================
--- 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java
 (original)
+++ 
incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSessionExecutor.java
 Wed Nov 29 13:26:23 2006
@@ -63,8 +63,11 @@
 
     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 @@
     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();
         }
     }
 


Reply via email to