summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/QueueRegistry.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-03-07 17:25:47 +0000
committerAlan Conway <aconway@apache.org>2013-03-07 17:25:47 +0000
commitd1a74e579f1c61afe7485e3f42767502d43f7623 (patch)
tree1f094812ed4bfe7dd9b9ecb0b38b3386c7018f44 /cpp/src/qpid/broker/QueueRegistry.cpp
parentb4de4600d0be955c7ed27e890b82f58129607cc3 (diff)
downloadqpid-python-d1a74e579f1c61afe7485e3f42767502d43f7623.tar.gz
QPID-4630: HA Fix starting from persistent store.
This was implemented in r1390123 but broken by subsequent changes. When re-starting a persistent HA cluster, the broker that becomes primary keeps its recovered queues while backup brokers discard their recovered queues and catch up from the primary. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1453971 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/QueueRegistry.cpp')
-rw-r--r--cpp/src/qpid/broker/QueueRegistry.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/cpp/src/qpid/broker/QueueRegistry.cpp b/cpp/src/qpid/broker/QueueRegistry.cpp
index 576d0f198b..13f9bbe23c 100644
--- a/cpp/src/qpid/broker/QueueRegistry.cpp
+++ b/cpp/src/qpid/broker/QueueRegistry.cpp
@@ -59,6 +59,8 @@ QueueRegistry::declare(const string& name, const QueueSettings& settings,
QueueMap::iterator i = queues.find(name);
if (i == queues.end()) {
Queue::shared_ptr queue = create(name, settings);
+ // Allow ConfigurationObserver to modify settings before storing the message.
+ if (getBroker()) getBroker()->getConfigurationObservers().queueCreate(queue);
//Move this to factory also?
if (alternate)
queue->setAlternateExchange(alternate);//need to do this *before* create
@@ -67,16 +69,11 @@ QueueRegistry::declare(const string& name, const QueueSettings& settings,
queue->create();
}
queues[name] = queue;
- // NOTE: raiseEvent and queueCreate must be called with the lock held in
- // order to ensure events are generated in the correct order.
- // Call queueCreate before raiseEvents so it can add arguments that
- // will be included in the management event.
- if (getBroker()) getBroker()->getConfigurationObservers().queueCreate(queue);
result = std::pair<Queue::shared_ptr, bool>(queue, true);
} else {
result = std::pair<Queue::shared_ptr, bool>(i->second, false);
}
- if (getBroker() && getBroker()->getManagementAgent()) {
+ if (getBroker() && getBroker()->getManagementAgent()) {
getBroker()->getManagementAgent()->raiseEvent(
_qmf::EventQueueDeclare(
connectionId, userId, name,