qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r604169 - in /incubator/qpid/trunk/qpid/cpp/src/qpid/broker: Message.cpp Queue.cpp
Date Fri, 14 Dec 2007 11:24:15 GMT
Author: gsim
Date: Fri Dec 14 03:24:15 2007
New Revision: 604169

URL: http://svn.apache.org/viewvc?rev=604169&view=rev
Log:
Only release content for durable queues.


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp?rev=604169&r1=604168&r2=604169&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp Fri Dec 14 03:24:15 2007
@@ -145,16 +145,18 @@
 
 void Message::releaseContent(MessageStore* _store)
 {
-    if (!store){
-		store = _store;
-	}
-    if (!getPersistenceId()) {
-        intrusive_ptr<PersistableMessage> pmsg(this);
-        store->stage(pmsg);
+    if (!store) {
+        store = _store;
+    }
+    if (store) {
+        if (!getPersistenceId()) {
+            intrusive_ptr<PersistableMessage> pmsg(this);
+            store->stage(pmsg);
+        }
+        //remove any content frames from the frameset
+        frames.remove(TypeFilter<CONTENT_BODY>());
+        setContentReleased();
     }
-    //remove any content frames from the frameset
-    frames.remove(TypeFilter<CONTENT_BODY>());
-    setContentReleased();
 }
 
 void Message::sendContent(Queue& queue, framing::FrameHandler& out, uint16_t maxFrameSize)
const

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=604169&r1=604168&r2=604169&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Fri Dec 14 03:24:15 2007
@@ -388,7 +388,13 @@
     if (policy.get()) {
         policy->enqueued(msg->contentSize());
         if (policy->limitExceeded()) {
-            msg->releaseContent(store);
+            if (store) {
+                QPID_LOG(debug, "Message " << msg << " on " << name <<
" released from memory");
+                msg->releaseContent(store);
+            } else {
+                QPID_LOG(warning, "Message " << msg << " on " << name
+                         << " exceeds the policy for the queue but can't be released
from memory as the queue is not durable");
+            }
         }
     }
     notify();



Mime
View raw message