diff options
| author | Carl C. Trieloff <cctrieloff@apache.org> | 2008-10-17 01:27:45 +0000 |
|---|---|---|
| committer | Carl C. Trieloff <cctrieloff@apache.org> | 2008-10-17 01:27:45 +0000 |
| commit | 5644e4fbfd777921b33874aed13c45d544c8a383 (patch) | |
| tree | 7f9f1527a43f46ff92a43088ac13d0faf6224719 /cpp/src/qpid/broker/TopicExchange.cpp | |
| parent | bf54dc92bf7d46862cbef3113314b7b16797d92e (diff) | |
| download | qpid-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/broker/TopicExchange.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/TopicExchange.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/cpp/src/qpid/broker/TopicExchange.cpp b/cpp/src/qpid/broker/TopicExchange.cpp index d9be8b0d68..691b42a1ae 100644 --- a/cpp/src/qpid/broker/TopicExchange.cpp +++ b/cpp/src/qpid/broker/TopicExchange.cpp @@ -131,19 +131,22 @@ TopicExchange::TopicExchange(const std::string& _name, bool _durable, } bool TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/){ - RWlock::ScopedWlock l(lock); - TopicPattern routingPattern(routingKey); - if (isBound(queue, routingPattern)) { - return false; - } else { - Binding::shared_ptr binding (new Binding (routingKey, queue, this)); - bindings[routingPattern].push_back(binding); - if (mgmtExchange != 0) { - mgmtExchange->inc_bindingCount(); - ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount(); + { + RWlock::ScopedWlock l(lock); + TopicPattern routingPattern(routingKey); + if (isBound(queue, routingPattern)) { + return false; + } else { + Binding::shared_ptr binding (new Binding (routingKey, queue, this)); + bindings[routingPattern].push_back(binding); + if (mgmtExchange != 0) { + mgmtExchange->inc_bindingCount(); + ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount(); + } } - return true; } + routeIVE(); + return true; } bool TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/){ |
