summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-06-30 21:55:17 +0000
committerGordon Sim <gsim@apache.org>2010-06-30 21:55:17 +0000
commite5b931c37b591ed19fa5a63afd2d05d6f1fca13e (patch)
tree4920e051a43724d37916e8613dba6bb27ef04ec8 /cpp
parentedff721d2ca6140fe2767d035cbe8b3709fb6e72 (diff)
downloadqpid-python-e5b931c37b591ed19fa5a63afd2d05d6f1fca13e.tar.gz
QPID-664: corrected option name for setting subscribe options on a queue
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@959451 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/client/amqp0_10/AddressResolution.cpp4
-rw-r--r--cpp/src/tests/MessagingSessionTests.cpp13
2 files changed, 15 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp b/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
index b819906677..f1295a3b66 100644
--- a/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
+++ b/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
@@ -452,8 +452,8 @@ QueueSource::QueueSource(const Address& address) :
//extract subscription arguments from address options (nb: setting
//of accept-mode/acquire-mode/destination controlled though other
//options)
- exclusive = Opt(address)/NODE/LINK/X_SUBSCRIBE/EXCLUSIVE;
- (Opt(address)/NODE/LINK/X_SUBSCRIBE/ARGUMENTS).collect(options);
+ exclusive = Opt(address)/LINK/X_SUBSCRIBE/EXCLUSIVE;
+ (Opt(address)/LINK/X_SUBSCRIBE/ARGUMENTS).collect(options);
}
void QueueSource::subscribe(qpid::client::AsyncSession& session, const std::string& destination)
diff --git a/cpp/src/tests/MessagingSessionTests.cpp b/cpp/src/tests/MessagingSessionTests.cpp
index 6fee1233d6..c22cb4bf73 100644
--- a/cpp/src/tests/MessagingSessionTests.cpp
+++ b/cpp/src/tests/MessagingSessionTests.cpp
@@ -756,6 +756,19 @@ QPID_AUTO_TEST_CASE(testSendSpecialProperties)
BOOST_CHECK_EQUAL(in.getMessageProperties().getMessageId().str(), out.getMessageId());
}
+QPID_AUTO_TEST_CASE(testExclusiveSubscriber)
+{
+ QueueFixture fix;
+ std::string address = (boost::format("%1%; { link: { x-subscribe : { exclusive:true } } }") % fix.queue).str();
+ Receiver receiver = fix.session.createReceiver(address);
+ ScopedSuppressLogging sl;
+ try {
+ fix.session.createReceiver(address);
+ fix.session.sync();
+ BOOST_FAIL("Expected exception.");
+ } catch (const MessagingException& e) {}
+}
+
QPID_AUTO_TEST_SUITE_END()