You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/05/17 17:47:04 UTC

svn commit: r1483878 - /activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala

Author: chirino
Date: Fri May 17 15:47:04 2013
New Revision: 1483878

URL: http://svn.apache.org/r1483878
Log:
Fixes failing ThreeBrokerVirtualTopicNetwork test associated /w AMQ-4296

Modified:
    activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala

Modified: activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala?rev=1483878&r1=1483877&r2=1483878&view=diff
==============================================================================
--- activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala (original)
+++ activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala Fri May 17 15:47:04 2013
@@ -255,6 +255,14 @@ class LevelDBStore extends LockableServi
         }
       }
     }
+
+    // Remove topics that don't have subs..
+    for( (name, topic) <- topics.toArray ) {
+      if( topic.subscription_count == 0 ) {
+        removeTopicMessageStore(name)
+      }
+    }
+
     debug("started")
   }
 
@@ -754,6 +762,10 @@ class LevelDBStore extends LockableServi
       super.asyncAddQueueMessage(context, message, false)
     }
 
+    def subscription_count = subscriptions.synchronized {
+      subscriptions.size
+    }
+
     def gcPosition:Option[(Long, Long)] = {
       var pos = lastSeq.get()
       subscriptions.synchronized {