You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2013/07/18 21:50:02 UTC
svn commit: r1504621 -
/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
Author: gsim
Date: Thu Jul 18 19:50:01 2013
New Revision: 1504621
URL: http://svn.apache.org/r1504621
Log:
QPID-5002: durable links are reliable by default; autodelete subscription queue specified only if neither durable nor reliable
Modified:
qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.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=1504621&r1=1504620&r2=1504621&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 Thu Jul 18 19:50:01 2013
@@ -240,8 +240,8 @@ class Subscription : public Exchange, pu
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::getSubscriptio
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::clien
//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:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org