qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1176363 - in /qpid/trunk/qpid/cpp/src: qpid/client/amqp0_10/AddressResolution.cpp tests/MessagingSessionTests.cpp
Date Tue, 27 Sep 2011 12:53:45 GMT
Author: gsim
Date: Tue Sep 27 12:53:45 2011
New Revision: 1176363

URL: http://svn.apache.org/viewvc?rev=1176363&view=rev
Log:
QPID-3508: Ensure subscription queue is deleted on closing receiver (unless it has explicitly
been configured non-exclusive)

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
    qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp?rev=1176363&r1=1176362&r2=1176363&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp Tue Sep 27 12:53:45
2011
@@ -583,7 +583,7 @@ void Subscription::cancel(qpid::client::
 {
     linkBindings.unbind(session);
     session.messageCancel(destination);
-    if (reliable) session.queueDelete(arg::queue=queue, arg::ifUnused=true);
+    if (exclusiveQueue) session.queueDelete(arg::queue=queue, arg::ifUnused=true);
     checkDelete(session, FOR_RECEIVER);
 }
 

Modified: qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp?rev=1176363&r1=1176362&r2=1176363&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp Tue Sep 27 12:53:45 2011
@@ -1100,6 +1100,24 @@ QPID_AUTO_TEST_CASE(testCreateBindingsOn
     BOOST_CHECK_EQUAL(in.getSubject(), out.getSubject());
 }
 
+QPID_AUTO_TEST_CASE(testUnsubscribeOnClose)
+{
+    MessagingFixture fix;
+    Sender sender = fix.session.createSender("my-exchange/my-subject; {create: always, delete:sender,
node:{type:topic, x-declare:{alternate-exchange:amq.fanout}}}");
+    Receiver receiver = fix.session.createReceiver("my-exchange/my-subject");
+    Receiver deadletters = fix.session.createReceiver("amq.fanout");
+
+    sender.send(Message("first"));
+    Message in = receiver.fetch(Duration::SECOND);
+    BOOST_CHECK_EQUAL(in.getContent(), std::string("first"));
+    fix.session.acknowledge();
+    receiver.close();
+    sender.send(Message("second"));
+    in = deadletters.fetch(Duration::SECOND);
+    BOOST_CHECK_EQUAL(in.getContent(), std::string("second"));
+    fix.session.acknowledge();
+}
+
 QPID_AUTO_TEST_SUITE_END()
 
 }} // namespace qpid::tests



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message