Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,23 @@ namespace statusengine {

Exchange = GetTomlDefault<>(tbl, "Exchange", std::string("statusengine"));

DurableExchange = GetTomlDefault<>(tbl, "DurableExchange", false);
DurableQueues = GetTomlDefault<>(tbl, "DurableQueues", false);
// Durable by default. A queue that is neither durable nor exclusive is
// RabbitMQ's deprecated transient_nonexcl_queues feature: 3.13 warns once per
// broker start, 4.x refuses the declare outright, and the broker then fails to
// connect at all (see Connect()). Durable has worked since AMQP 0-9-1, so it is
// the only value that works on every supported broker version.
//
// This does not put events on disk. Queue durability and message persistence
// are separate: durable stores the queue *definition*, while messages are only
// written durably when the publisher marks them persistent - and SendMessage
// passes properties=nullptr, i.e. transient. So the queues still buffer in RAM
// and a broker restart still empties them, which is the intended behaviour.
//
// The exchange follows the queues: a transient exchange loses its bindings on a
// broker restart while the durable queues survive, and keeping the pair
// consistent costs nothing, both being metadata only.
DurableExchange = GetTomlDefault<>(tbl, "DurableExchange", true);
DurableQueues = GetTomlDefault<>(tbl, "DurableQueues", true);

SSL = GetTomlDefault<>(tbl, "SSL", false);

Expand Down
8 changes: 6 additions & 2 deletions statusengine.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ WorkerCommand = "statusngin_cmd"
##Vhost = "/"
##Timeout = 30
##Exchange = "statusengine"
##DurableExchange = false
##DurableQueues = false
## Durable queues and exchange. Required by RabbitMQ 4, which refuses to declare a queue
## that is neither durable nor exclusive. This stores queue and exchange *definitions* on
## disk, not the events: messages are published transient, so the queues still buffer in
## RAM and are still emptied by a broker restart.
##DurableExchange = true
##DurableQueues = true
##SSL = false
##SSL_verify = true
##SSL_cacert = ""
Expand Down