diff options
author | Gordon Sim <gsim@apache.org> | 2009-11-19 23:07:55 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-11-19 23:07:55 +0000 |
commit | 9022d18bbf269d800eeedce9aafc8bb7c9496b4f (patch) | |
tree | c845e49435627daec233c7457a8d08839284f094 /cpp/src | |
parent | a05ba7af38a0d5df2b8a7cc30af1a06949f0484a (diff) | |
download | qpid-python-9022d18bbf269d800eeedce9aafc8bb7c9496b4f.tar.gz |
QPID-664: Added some documentation for address options; tidied up the handling of queue- and subscribe- arguments
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@882350 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/client/amqp0_10/AddressResolution.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp b/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp index 89cc053ff7..6cc7fcc587 100644 --- a/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp +++ b/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp @@ -179,7 +179,7 @@ class QueueSource : public Queue, public MessageSource private: const AcceptMode acceptMode; const AcquireMode acquireMode; - const bool exclusive; + bool exclusive; FieldTable options; }; @@ -344,10 +344,19 @@ QueueSource::QueueSource(const Address& address) : Queue(address), acceptMode(is_unreliable(address) ? ACCEPT_MODE_NONE : ACCEPT_MODE_EXPLICIT), acquireMode(address.getOption(BROWSE).asBool() ? ACQUIRE_MODE_NOT_ACQUIRED : ACQUIRE_MODE_PRE_ACQUIRED), - exclusive(getNestedOption(address.getOptions(), list_of<std::string>(X_PROPERTIES)(EXCLUSIVE)).asBool()) + exclusive(false) { //extract subscription arguments from address options - convert(address.getOption(xamqp::SUBSCRIBE_ARGUMENTS), options); + const Variant& x = address.getOption(X_PROPERTIES); + if (!x.isVoid()) { + const Variant::Map& xProps = x.asMap(); + Variant::Map passthrough; + for (Variant::Map::const_iterator i = xProps.begin(); i != xProps.end(); ++i) { + if (i->first == xamqp::EXCLUSIVE) exclusive = i->second; + else passthrough[i->first] = i->second; + } + translate(passthrough, options); + } } void QueueSource::subscribe(qpid::client::AsyncSession& session, const std::string& destination) @@ -384,8 +393,16 @@ Subscription::Subscription(const Address& address, const std::string& exchangeTy durable(address.getOption(DURABLE_SUBSCRIPTION).asBool()) { if (address.getOption(NO_LOCAL).asBool()) queueOptions.setInt(NO_LOCAL, 1); - convert(address.getOption(xamqp::QUEUE_ARGUMENTS), queueOptions); - convert(address.getOption(xamqp::SUBSCRIBE_ARGUMENTS), subscriptionOptions); + const Variant& x = address.getOption(X_PROPERTIES); + if (!x.isVoid()) { + const Variant::Map& xProps = x.asMap(); + Variant::Map passthrough; + for (Variant::Map::const_iterator i = xProps.begin(); i != xProps.end(); ++i) { + if (i->first == xamqp::QUEUE_ARGUMENTS) convert(i->second.asMap(), queueOptions); + else passthrough[i->first] = i->second; + } + translate(passthrough, subscriptionOptions); + } const Variant& filter = address.getOption(FILTER); if (!filter.isVoid()) { |