[
https://issues.apache.org/jira/browse/QPID-2335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800298#action_12800298
]
Gordon Sim commented on QPID-2335:
----------------------------------
What about:
Index: cpp/src/qpid/xml/XmlExchange.cpp
===================================================================
--- cpp/src/qpid/xml/XmlExchange.cpp (revision 898714)
+++ cpp/src/qpid/xml/XmlExchange.cpp (working copy)
@@ -82,7 +82,7 @@
XmlBinding::vector::ConstPtr p = bindings.snapshot();
if (!p || std::find_if(p->begin(), p->end(), MatchQueue(queue)) ==
p->end()) {
Query query(xqilla.parse(X(queryText.c_str())));
- XmlBinding::shared_ptr binding(new XmlBinding (routingKey,
queue, this, query));
+ XmlBinding::shared_ptr binding(new XmlBinding (routingKey,
queue, this, *bindingArguments, query));
bindings.add(binding);
QPID_LOG(trace, "Bound successfully with query: " << queryText
);
Index: cpp/src/qpid/xml/XmlExchange.h
===================================================================
--- cpp/src/qpid/xml/XmlExchange.h (revision 898714)
+++ cpp/src/qpid/xml/XmlExchange.h (working copy)
@@ -49,8 +49,8 @@
boost::shared_ptr<XQQuery> xquery;
bool parse_message_content;
- XmlBinding(const std::string& key, const Queue::shared_ptr queue,
Exchange* parent, Query query):
- Binding(key, queue, parent), xquery(query),
parse_message_content(true) {}
+ XmlBinding(const std::string& key, const Queue::shared_ptr queue,
Exchange* parent, const framing::FieldTable& args, Query query):
+ Binding(key, queue, parent, args), xquery(query),
parse_message_content(true) {}
};
Your concern around potential concurrent access to
Exchange::Binding::mgmtBinding seems like it would be better addressed via a
separate Jira? My inclination (though I'm not sure I properly understand your
concern) would be something simple like making that member private:
Index: cpp/src/qpid/broker/Exchange.cpp
===================================================================
--- cpp/src/qpid/broker/Exchange.cpp (revision 898714)
+++ cpp/src/qpid/broker/Exchange.cpp (working copy)
@@ -87,9 +87,7 @@
msg.getMessage().blockContentRelease();
for(std::vector<Binding::shared_ptr>::const_iterator i = b->begin(); i
!= b->end(); i++, count++) {
- msg.deliverTo((*i)->queue);
- if ((*i)->mgmtBinding != 0)
- (*i)->mgmtBinding->inc_msgMatched();
+ (*i)->route(msg);
}
}
@@ -333,6 +331,13 @@
}
}
+void Exchange::Binding::route(Deliverable& msg)
+{
+ msg.deliverTo(queue);
+ if (mgmtBinding != 0)
+ mgmtBinding->inc_msgMatched();
+}
+
Exchange::Binding::~Binding ()
{
if (mgmtBinding != 0) {
Index: cpp/src/qpid/broker/Exchange.h
===================================================================
--- cpp/src/qpid/broker/Exchange.h (revision 898714)
+++ cpp/src/qpid/broker/Exchange.h (working copy)
@@ -41,19 +41,22 @@
class Exchange : public PersistableExchange, public management::Manageable {
public:
- struct Binding : public management::Manageable {
+ class Binding : public management::Manageable {
+ public:
typedef boost::shared_ptr<Binding> shared_ptr;
typedef std::vector<Binding::shared_ptr> vector;
Queue::shared_ptr queue;
const std::string key;
const framing::FieldTable args;
- qmf::org::apache::qpid::broker::Binding* mgmtBinding;
Binding(const std::string& key, Queue::shared_ptr queue, Exchange*
parent = 0,
framing::FieldTable args = framing::FieldTable(), const
std::string& origin = std::string());
~Binding();
management::ManagementObject* GetManagementObject() const;
+ void route(Deliverable& msg);
+ private:
+ qmf::org::apache::qpid::broker::Binding* mgmtBinding;
};
private:
> Arguments for a binding to an XML exchange are not visible through management
> -----------------------------------------------------------------------------
>
> Key: QPID-2335
> URL: https://issues.apache.org/jira/browse/QPID-2335
> Project: Qpid
> Issue Type: Bug
> Components: C++ Broker
> Affects Versions: 0.6
> Reporter: Ted Ross
> Assignee: Ted Ross
> Priority: Minor
>
> If you create a binding to the XML exchange (using
> python/examples/xml-exchange/declare_queues.py for example), then look at the
> binding using qpid-tool, the arguments field is {} (an empty map).
> Arguments for headers exchanges can be viewed correctly, this only affects
> the xml exchange.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]