summaryrefslogtreecommitdiff
path: root/cpp/lib/broker/Broker.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-03-21 16:01:45 +0000
committerGordon Sim <gsim@apache.org>2007-03-21 16:01:45 +0000
commitdf4faa062b3512312c78167bfbdf19ff969210ac (patch)
tree246a634754e2023df1692977fb9c347cba9795db /cpp/lib/broker/Broker.cpp
parent9f994dad07799d26e9ecc7241863e7c48c952c99 (diff)
downloadqpid-python-df4faa062b3512312c78167bfbdf19ff969210ac.tar.gz
Modifications to allow messages produced by the message class to be persisted as well as those from the basic class.
Fix to broker initialisation (ensure queues use the correct store). git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@520924 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib/broker/Broker.cpp')
-rw-r--r--cpp/lib/broker/Broker.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/cpp/lib/broker/Broker.cpp b/cpp/lib/broker/Broker.cpp
index f650452e33..335ce2b3a0 100644
--- a/cpp/lib/broker/Broker.cpp
+++ b/cpp/lib/broker/Broker.cpp
@@ -47,17 +47,13 @@ const std::string amq_match("amq.match");
Broker::Broker(const Configuration& conf) :
config(conf),
+ store(createStore(conf)),
queues(store.get()),
timeout(30000),
stagingThreshold(0),
cleaner(&queues, timeout/10),
factory(*this)
{
- if (config.getStore().empty())
- store.reset(new NullMessageStore(config.isTrace()));
- else
- store.reset(new MessageStoreModule(config.getStore()));
-
exchanges.declare(empty, DirectExchange::typeName); // Default exchange.
exchanges.declare(amq_direct, DirectExchange::typeName);
exchanges.declare(amq_topic, TopicExchange::typeName);
@@ -84,6 +80,13 @@ Broker::shared_ptr Broker::create(int16_t port)
Broker::shared_ptr Broker::create(const Configuration& config) {
return Broker::shared_ptr(new Broker(config));
}
+
+MessageStore* Broker::createStore(const Configuration& config) {
+ if (config.getStore().empty())
+ return new NullMessageStore(config.isTrace());
+ else
+ return new MessageStoreModule(config.getStore());
+}
void Broker::run() {
getAcceptor().run(&factory);