[jboss-cvs] JBoss Messaging SVN: r8110 - branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Oct 30 02:27:37 EDT 2010


Author: gaohoward
Date: 2010-10-30 02:27:35 -0400 (Sat, 30 Oct 2010)
New Revision: 8110

Modified:
   branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
   branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
Log:
non persistent handling


Modified: branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2010-10-29 14:57:39 UTC (rev 8109)
+++ branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2010-10-30 06:27:35 UTC (rev 8110)
@@ -332,16 +332,19 @@
          if (remote)
          {
             PersistenceManager pm = sessionEndpoint.getPersistenceManager();
-            try
+            if (ref.getMessage().isReliable() && messageQueue.isRecoverable())
             {
-               pm.updateMessageState(messageQueue.getChannelID(), ref, "S");
+               try
+               {
+                  pm.updateMessageState(messageQueue.getChannelID(), ref, "S");
+               }
+               catch (Exception e)
+               {
+                  //we need to stop the sucking process. the message should be re-delivered.
+                  log.error("Failed to update state for message: " + ref, e);
+                  return null;
+               }
             }
-            catch (Exception e)
-            {
-               //we need to stop the sucking process. the message should be re-delivered.
-               log.error("Failed to update state for message: " + ref, e);
-               return null;
-            }
             delivery.setSucked(true);
          }
          

Modified: branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2010-10-29 14:57:39 UTC (rev 8109)
+++ branches/JBMESSAGING-1822/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2010-10-30 06:27:35 UTC (rev 8110)
@@ -1236,17 +1236,20 @@
             {
                //we need to reverse the message (if still there). If reverse failed, we don't do 
                //cancel.
-               try
+               if (rec.del.getReference().getMessage().isReliable() && rec.getConsumer().getChannel().isRecoverable())
                {
-                  //now ask pm to do it.
-                  pm.updateMessageState(rec.getConsumer().getChannelID(), rec.del.getReference(), "C");
+                  try
+                  {
+                     //now ask pm to do it.
+                     pm.updateMessageState(rec.getConsumer().getChannelID(), rec.del.getReference(), "C");
+                  }
+                  catch (Exception e)
+                  {
+                     //if update failed, it must be a DB failure, we log the error and let others be canceled
+                     log.error("Failed to update message " + rec.del.getReference() + " to state C", e);
+                     continue;
+                  }
                }
-               catch (Exception e)
-               {
-                  //if update failed, it must be a DB failure, we log the error and let others be canceled
-                  log.error("Failed to update message " + rec.del.getReference() + " to state C", e);
-                  continue;
-               }
             }
 
             /*
@@ -1697,18 +1700,21 @@
          {
             //we need to reverse the message (if still there). If reverse failed, we don't do 
             //cancel.
-            try
+            if (rec.del.getReference().getMessage().isReliable() && rec.getConsumer().getChannel().isRecoverable())
             {
-               //now ask pm to do it.
-               pm.updateMessageState(rec.getConsumer().getChannelID(), rec.del.getReference(), "C");
-            }
-            catch (Exception e)
-            {
-               if (trace)
+               try
                {
-                  log.trace("Failed to update message " + rec.del.getReference() + " to state C");
+                  //now ask pm to do it.
+                  pm.updateMessageState(rec.getConsumer().getChannelID(), rec.del.getReference(), "C");
                }
-               return null;
+               catch (Exception e)
+               {
+                  if (trace)
+                  {
+                     log.trace("Failed to update message " + rec.del.getReference() + " to state C");
+                  }
+                  return null;
+               }
             }
          }
       }



More information about the jboss-cvs-commits mailing list