summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/xml/XmlExchange.cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2008-10-17 01:27:45 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2008-10-17 01:27:45 +0000
commit5644e4fbfd777921b33874aed13c45d544c8a383 (patch)
tree7f9f1527a43f46ff92a43088ac13d0faf6224719 /cpp/src/qpid/xml/XmlExchange.cpp
parentbf54dc92bf7d46862cbef3113314b7b16797d92e (diff)
downloadqpid-python-5644e4fbfd777921b33874aed13c45d544c8a383.tar.gz
Feature requested by AndrewM for M4...
- provide initial value support, for late joining consumers git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@705443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/xml/XmlExchange.cpp')
-rw-r--r--cpp/src/qpid/xml/XmlExchange.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/cpp/src/qpid/xml/XmlExchange.cpp b/cpp/src/qpid/xml/XmlExchange.cpp
index 53eb0f20b8..d3269882d7 100644
--- a/cpp/src/qpid/xml/XmlExchange.cpp
+++ b/cpp/src/qpid/xml/XmlExchange.cpp
@@ -86,22 +86,21 @@ bool XmlExchange::bind(Queue::shared_ptr queue, const string& routingKey, const
try {
RWlock::ScopedWlock l(lock);
- XmlBinding::vector& bindings(bindingsMap[routingKey]);
- 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));
- bindings.add(binding);
- QPID_LOG(trace, "Bound successfully with query: " << queryText );
-
- if (mgmtExchange != 0) {
- mgmtExchange->inc_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
+ XmlBinding::vector& bindings(bindingsMap[routingKey]);
+ 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));
+ bindings.add(binding);
+ QPID_LOG(trace, "Bound successfully with query: " << queryText );
+
+ if (mgmtExchange != 0) {
+ mgmtExchange->inc_bindingCount();
+ ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
+ }
+ } else {
+ return false;
}
- return true;
- } else {
- return false;
- }
}
catch (XQException& e) {
throw InternalErrorException(QPID_MSG("Could not parse xquery:"+ queryText));
@@ -109,6 +108,8 @@ bool XmlExchange::bind(Queue::shared_ptr queue, const string& routingKey, const
catch (...) {
throw InternalErrorException(QPID_MSG("Unexpected error - Could not parse xquery:"+ queryText));
}
+ routeIVE();
+ return true;
}
bool XmlExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/)