summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-07-18 19:50:01 +0000
committerGordon Sim <gsim@apache.org>2013-07-18 19:50:01 +0000
commit3695f380f3d9635e05561f37033e18d6804c69a6 (patch)
treef5bd9933267d455988fcc4198eff3441da596fee /qpid/cpp/src
parent2a32b230c2d35e4cdce48c970ab61b14339e8458 (diff)
downloadqpid-python-3695f380f3d9635e05561f37033e18d6804c69a6.tar.gz
QPID-5002: durable links are reliable by default; autodelete subscription queue specified only if neither durable nor reliable
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1504621 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp b/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
index dac2a4a6d9..6d87e1362a 100644
--- a/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
+++ b/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
@@ -240,8 +240,8 @@ class Subscription : public Exchange, public MessageSource
void cancel(qpid::client::AsyncSession& session, const std::string& destination);
private:
const std::string queue;
- const bool reliable;
const bool durable;
+ const bool reliable;
const std::string actualType;
const bool exclusiveQueue;
const bool exclusiveSubscription;
@@ -516,8 +516,10 @@ std::string Subscription::getSubscriptionName(const std::string& base, const std
Subscription::Subscription(const Address& address, const std::string& type)
: Exchange(address),
queue(getSubscriptionName(name, (Opt(address)/LINK/NAME).str())),
- reliable(AddressResolution::is_reliable(address)),
durable(Opt(address)/LINK/DURABLE),
+ //if the link is durable, then assume it is also reliable unless expclitly stated otherwise
+ //if not assume it is unreliable unless expclitly stated otherwise
+ reliable(durable ? !AddressResolution::is_unreliable(address) : AddressResolution::is_reliable(address)),
actualType(type.empty() ? (specifiedType.empty() ? TOPIC_EXCHANGE : specifiedType) : type),
exclusiveQueue((Opt(address)/LINK/X_DECLARE/EXCLUSIVE).asBool(true)),
exclusiveSubscription((Opt(address)/LINK/X_SUBSCRIBE/EXCLUSIVE).asBool(exclusiveQueue)),
@@ -584,7 +586,7 @@ void Subscription::subscribe(qpid::client::AsyncSession& session, const std::str
//create subscription queue:
session.queueDeclare(arg::queue=queue, arg::exclusive=exclusiveQueue,
- arg::autoDelete=!reliable, arg::durable=durable,
+ arg::autoDelete=!(durable || reliable), arg::durable=durable,
arg::alternateExchange=alternateExchange,
arg::arguments=queueOptions);
//'default' binding: