activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1483878 - /activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
Date Fri, 17 May 2013 15:47:04 GMT
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 {



Mime
View raw message