summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Broker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/Broker.cpp')
-rw-r--r--cpp/src/qpid/broker/Broker.cpp55
1 files changed, 23 insertions, 32 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp
index 0a45c46d30..4f7686aac4 100644
--- a/cpp/src/qpid/broker/Broker.cpp
+++ b/cpp/src/qpid/broker/Broker.cpp
@@ -53,6 +53,9 @@
#if HAVE_SASL
#include <sasl/sasl.h>
+static const bool AUTH_DEFAULT=true;
+#else
+static const bool AUTH_DEFAULT=false;
#endif
using qpid::sys::ProtocolFactory;
@@ -81,41 +84,25 @@ Broker::Options::Options(const std::string& name) :
stagingThreshold(5000000),
enableMgmt(1),
mgmtPubInterval(10),
-#if HAVE_SASL
- auth(true),
-#else
- auth(false),
-#endif
- realm("QPID"),
- ack(0)
+ auth(AUTH_DEFAULT),
+ replayFlushLimit(64),
+ replayHardLimit(0)
{
int c = sys::SystemInfo::concurrency();
workerThreads=c+1;
addOptions()
- ("data-dir", optValue(dataDir,"DIR"),
- "Directory to contain persistent data generated by the broker")
- ("no-data-dir", optValue(noDataDir),
- "Don't use a data directory. No persistent configuration will be loaded or stored")
- ("port,p", optValue(port,"PORT"),
- "Tells the broker to listen on PORT")
- ("worker-threads", optValue(workerThreads, "N"),
- "Sets the broker thread pool size")
- ("max-connections", optValue(maxConnections, "N"),
- "Sets the maximum allowed connections")
- ("connection-backlog", optValue(connectionBacklog, "N"),
- "Sets the connection backlog limit for the server socket")
- ("staging-threshold", optValue(stagingThreshold, "N"),
- "Stages messages over N bytes to disk")
- ("mgmt-enable,m", optValue(enableMgmt,"yes|no"),
- "Enable Management")
- ("mgmt-pub-interval", optValue(mgmtPubInterval, "SECONDS"),
- "Management Publish Interval")
- ("auth", optValue(auth, "yes|no"),
- "Enable authentication, if disabled all incoming connections will be trusted")
- ("realm", optValue(realm, "REALM"),
- "Use the given realm when performing authentication")
- ("ack", optValue(ack, "N"),
- "Send session.ack/solicit-ack at least every N frames. 0 disables voluntary ack/solitict-ack");
+ ("data-dir", optValue(dataDir,"DIR"), "Directory to contain persistent data generated by the broker")
+ ("no-data-dir", optValue(noDataDir), "Don't use a data directory. No persistent configuration will be loaded or stored")
+ ("port,p", optValue(port,"PORT"), "Tells the broker to listen on PORT")
+ ("worker-threads", optValue(workerThreads, "N"), "Sets the broker thread pool size")
+ ("max-connections", optValue(maxConnections, "N"), "Sets the maximum allowed connections")
+ ("connection-backlog", optValue(connectionBacklog, "N"), "Sets the connection backlog limit for the server socket")
+ ("staging-threshold", optValue(stagingThreshold, "N"), "Stages messages over N bytes to disk")
+ ("mgmt-enable,m", optValue(enableMgmt,"yes|no"), "Enable Management")
+ ("mgmt-pub-interval", optValue(mgmtPubInterval, "SECONDS"), "Management Publish Interval")
+ ("auth", optValue(auth, "yes|no"), "Enable authentication, if disabled all incoming connections will be trusted")
+ ("replay-flush-limit", optValue(replayFlushLimit, "KB"), "Send flush request when the replay buffer reaches this limit. 0 means no limit.")
+ ("replay-hard-limit", optValue(replayHardLimit, "KB"), "Kill a session if its replay buffer exceeds this limit. 0 means no limit.");
}
const std::string empty;
@@ -132,7 +119,11 @@ Broker::Broker(const Broker::Options& conf) :
dataDir(conf.noDataDir ? std::string () : conf.dataDir),
links(this),
factory(*this),
- sessionManager(conf.ack)
+ sessionManager(
+ qpid::SessionState::Configuration(
+ conf.replayFlushLimit*1024, // convert kb to bytes.
+ conf.replayHardLimit*1024),
+ *this)
{
if(conf.enableMgmt){
QPID_LOG(info, "Management enabled");