[jboss-cvs] JBoss Messaging SVN: r8360 - branches/Branch_1_4/src/main/org/jboss/jms/client/container.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 21 08:23:47 EDT 2011


Author: gaohoward
Date: 2011-06-21 08:23:46 -0400 (Tue, 21 Jun 2011)
New Revision: 8360

Modified:
   branches/Branch_1_4/src/main/org/jboss/jms/client/container/ClientConsumer.java
Log:
JBMESSAGING-1876
fix message gets lost in to next tx


Modified: branches/Branch_1_4/src/main/org/jboss/jms/client/container/ClientConsumer.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/client/container/ClientConsumer.java	2011-06-21 05:12:09 UTC (rev 8359)
+++ branches/Branch_1_4/src/main/org/jboss/jms/client/container/ClientConsumer.java	2011-06-21 12:23:46 UTC (rev 8360)
@@ -661,6 +661,23 @@
                      {
                         log.warn("Timed out waiting for post message processing " + m + " within time " + timeLeft);
                         ignore = false;
+                        if (sessionDelegate.getTransacted())
+                        {
+                           try
+                           {
+                              //to avoid message loss, we need to wait for the message added in the ack list of the current tx.
+                              if (trace) { log.trace("Waiting for the task to finish"); }
+                              ignore = f.get();
+                           }
+                           catch (InterruptedException e1)
+                           {
+                              log.warn("Interrupted during getting future result.", e);
+                           }
+                           catch (ExecutionException e1)
+                           {
+                              log.warn("Got exception getting future result.", e);
+                           }
+                        }
                         sessionDelegate.processMessageTimeout();
                      }
                   }



More information about the jboss-cvs-commits mailing list