activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r573397 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: BrokerService.java region/Queue.java region/TopicSubscription.java
Date Thu, 06 Sep 2007 22:14:35 GMT
Author: chirino
Date: Thu Sep  6 15:14:34 2007
New Revision: 573397

URL: http://svn.apache.org/viewvc?rev=573397&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1382... if the broker.persistent==false
then we should not create any files, not even for the Temp Store.


Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=573397&r1=573396&r2=573397&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Thu Sep  6 15:14:34 2007
@@ -1067,6 +1067,11 @@
      */
     public synchronized Store getTempDataStore() {
         if (tempDataStore == null) {
+            
+            if (!isPersistent()) {
+                return null;
+            }
+            
             boolean result = true;
             boolean empty = true;
             try {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=573397&r1=573396&r2=573397&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Thu Sep  6 15:14:34 2007
@@ -118,7 +118,7 @@
         this.memoryUsage = new MemoryUsage(systemUsage.getMemoryUsage(), destination.toString());
         this.memoryUsage.setUsagePortion(1.0f);
         this.store = store;
-        if (destination.isTemporary()) {
+        if (destination.isTemporary() || tmpStore==null ) {
             this.messages = new VMPendingMessageCursor();
         } else {
             this.messages = new StoreQueueCursor(this, tmpStore);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java?rev=573397&r1=573396&r2=573397&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
Thu Sep  6 15:14:34 2007
@@ -26,6 +26,7 @@
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.region.cursors.FilePendingMessageCursor;
 import org.apache.activemq.broker.region.cursors.PendingMessageCursor;
+import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor;
 import org.apache.activemq.broker.region.policy.MessageEvictionStrategy;
 import org.apache.activemq.broker.region.policy.OldestMessageEvictionStrategy;
 import org.apache.activemq.command.ConsumerControl;
@@ -36,6 +37,7 @@
 import org.apache.activemq.command.MessageDispatchNotification;
 import org.apache.activemq.command.MessagePull;
 import org.apache.activemq.command.Response;
+import org.apache.activemq.kaha.Store;
 import org.apache.activemq.transaction.Synchronization;
 import org.apache.activemq.usage.SystemUsage;
 import org.apache.commons.logging.Log;
@@ -66,8 +68,12 @@
         super(broker, context, info);
         this.usageManager = usageManager;
         String matchedName = "TopicSubscription:" + CURSOR_NAME_COUNTER.getAndIncrement()
+ "[" + info.getConsumerId().toString() + "]";
-        this.matched = new FilePendingMessageCursor(matchedName, broker.getTempDataStore());
-
+        Store tempDataStore = broker.getTempDataStore();
+        if (tempDataStore != null) {
+            this.matched = new FilePendingMessageCursor(matchedName, tempDataStore);
+        } else {
+            this.matched = new VMPendingMessageCursor();
+        }
     }
 
     public void init() throws Exception {



Mime
View raw message