[jboss-cvs] JBoss Messaging SVN: r1385 - trunk/src/main/org/jboss/jms/server/endpoint

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 28 19:55:12 EDT 2006


Author: ovidiu.feodorov at jboss.com
Date: 2006-09-28 19:55:10 -0400 (Thu, 28 Sep 2006)
New Revision: 1385

Modified:
   trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
Log:
temporary fix for the case described by http://jira.jboss.org/jira/browse/JBMESSAGING-564

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-09-28 23:53:14 UTC (rev 1384)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-09-28 23:55:10 UTC (rev 1385)
@@ -361,8 +361,8 @@
             
             JMSDispatcher.instance.unregisterTarget(new Integer(id));
             
-            //If this is a consumer of a non durable subscription
-            //then we want to unbind the subscription and delete all it's data
+            // If this is a consumer of a non durable subscription then we want to unbind the
+            // subscription and delete all its data.
 
             if (destination.isTopic())
             {
@@ -370,14 +370,17 @@
                   sessionEndpoint.getConnectionEndpoint().getServerPeer().getTopicPostOfficeInstance();
                
                Binding binding = topicPostOffice.getBindingForQueueName(queueName);
-               
-               if (binding == null)
+
+               // TODO - quick fix for the situation when the subscription was destroyed (using
+               //        Session.unsubscribe()) while the consumer is active. Not sure this is the
+               //        best solution, though. See http://jira.jboss.org/jira/browse/JBMESSAGING-564
+//               if (binding == null)
+//               {
+//                  throw new IllegalStateException("Cannot find queue with name " + queueName);
+//               }
+
+               if (binding != null && !binding.getQueue().isRecoverable())
                {
-                  throw new IllegalStateException("Cannot find queue with name " + queueName);
-               }
-               
-               if (!binding.getQueue().isRecoverable())
-               {                 
                   topicPostOffice.unbindQueue(queueName);
                }
             }




More information about the jboss-cvs-commits mailing list