summaryrefslogtreecommitdiff
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
commit480bd59feefdd4331c90629e86ef2d9061364950 (patch)
treeffd287252a687ff2d0a92fc0503222337e339561
parentecacc83649892847b8d241309844bf70926ee829 (diff)
downloadqpid-python-480bd59feefdd4331c90629e86ef2d9061364950.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/qpid@1504621 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/client/amqp0_10/AddressResolution.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp b/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
index dac2a4a6d9..6d87e1362a 100644
--- a/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
+++ b/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: