Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 874BC109B4 for ; Tue, 15 Oct 2013 12:42:09 +0000 (UTC) Received: (qmail 36196 invoked by uid 500); 15 Oct 2013 12:42:09 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 36160 invoked by uid 500); 15 Oct 2013 12:42:08 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 36153 invoked by uid 99); 15 Oct 2013 12:42:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 12:42:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 12:42:06 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7165E2388C06; Tue, 15 Oct 2013 12:41:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1532306 - in /qpid/trunk/qpid/cpp/src/qpid/broker/amqp: Session.cpp Topic.cpp Topic.h Date: Tue, 15 Oct 2013 12:41:46 -0000 To: commits@qpid.apache.org From: gsim@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131015124146.7165E2388C06@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gsim Date: Tue Oct 15 12:41:45 2013 New Revision: 1532306 URL: http://svn.apache.org/r1532306 Log: QPID-5228: allow alternate exchange to be set on 1.0 subscription queues Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.cpp qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.h Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp?rev=1532306&r1=1532305&r2=1532306&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp Tue Oct 15 12:41:45 2013 @@ -397,10 +397,12 @@ void Session::setupOutgoing(pn_link_t* l bool shared = is_capability_requested(SHARED, pn_terminus_capabilities(source)); bool durable = pn_terminus_get_durability(source); QueueSettings settings(durable, !durable); + std::string altExchange; if (node.topic) { settings = node.topic->getPolicy(); settings.durable = durable; settings.autodelete = !durable; + altExchange = node.topic->getAlternateExchange(); } settings.autoDeleteDelay = pn_terminus_get_timeout(source); if (settings.autoDeleteDelay) { @@ -419,7 +421,7 @@ void Session::setupOutgoing(pn_link_t* l queueName << connection.getContainerId() << "_" << pn_link_name(link); } boost::shared_ptr queue - = connection.getBroker().createQueue(queueName.str(), settings, this, "", connection.getUserId(), connection.getId()).first; + = connection.getBroker().createQueue(queueName.str(), settings, this, altExchange, connection.getUserId(), connection.getId()).first; if (!shared) queue->setExclusiveOwner(this); authorise.outgoing(node.exchange, queue, filter); filter.bind(node.exchange, queue); Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.cpp?rev=1532306&r1=1532305&r2=1532306&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.cpp Tue Oct 15 12:41:45 2013 @@ -31,6 +31,7 @@ namespace { const std::string TOPIC("topic"); const std::string EXCHANGE("exchange"); const std::string DURABLE("durable"); +const std::string ALTERNATE_EXCHANGE("alternate-exchange"); const std::string EMPTY; std::string getProperty(const std::string& k, const qpid::types::Variant::Map& m) @@ -52,22 +53,25 @@ qpid::types::Variant::Map filter(const q qpid::types::Variant::Map filtered = properties; filtered.erase(DURABLE); filtered.erase(EXCHANGE); + filtered.erase(ALTERNATE_EXCHANGE); return filtered; } } Topic::Topic(Broker& broker, const std::string& n, const qpid::types::Variant::Map& properties) - : PersistableObject(n, TOPIC, properties), name(n), durable(testProperty(DURABLE, properties)), exchange(broker.getExchanges().get(getProperty(EXCHANGE, properties))) + : PersistableObject(n, TOPIC, properties), name(n), durable(testProperty(DURABLE, properties)), exchange(broker.getExchanges().get(getProperty(EXCHANGE, properties))), + alternateExchange(getProperty(ALTERNATE_EXCHANGE, properties)) { if (exchange->getName().empty()) throw qpid::Exception("Exchange must be specified."); qpid::types::Variant::Map unused; - policy.populate(properties, unused); + qpid::types::Variant::Map filtered = filter(properties); + policy.populate(filtered, unused); qpid::management::ManagementAgent* agent = broker.getManagementAgent(); if (agent != 0) { topic = _qmf::Topic::shared_ptr(new _qmf::Topic(agent, this, name, exchange->GetManagementObject()->getObjectId(), durable)); - topic->set_properties(filter(properties)); + topic->set_properties(filtered); agent->addObject(topic); } } @@ -99,7 +103,10 @@ const std::string& Topic::getName() cons { return name; } - +const std::string& Topic::getAlternateExchange() const +{ + return alternateExchange; +} boost::shared_ptr TopicRegistry::createTopic(Broker& broker, const std::string& name, const qpid::types::Variant::Map& properties) { boost::shared_ptr topic(new Topic(broker, name, properties)); Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.h URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.h?rev=1532306&r1=1532305&r2=1532306&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.h (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Topic.h Tue Oct 15 12:41:45 2013 @@ -51,6 +51,7 @@ class Topic : public PersistableObject, ~Topic(); const std::string& getName() const; const QueueSettings& getPolicy() const; + const std::string& getAlternateExchange() const; boost::shared_ptr getExchange(); bool isDurable() const; boost::shared_ptr GetManagementObject() const; @@ -59,6 +60,7 @@ class Topic : public PersistableObject, bool durable; boost::shared_ptr exchange; QueueSettings policy; + std::string alternateExchange; qmf::org::apache::qpid::broker::Topic::shared_ptr topic; }; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org