pub struct Config {
pub name: String,
pub max_nodes: u32,
pub num_shards: u32,
pub nodes: Vec<ConfigNode>,
pub flush_timeout: u32,
pub pkt_batch_size: u32,
pub publish_retry_interval: u32,
}
Expand description
Broker configuration.
Fields§
§name: String
Human readable name of the broker-cluster.
- Default: None, must be supplied
- Mutable: No
max_nodes: u32
Maximum nodes that can exist in this cluster. When max_nodes
> 1 broker is
created in distributed mode using consensus algorithm (TODO).
- Default: Config::DEF_MAX_NODES.
- Mutable: No
num_shards: u32
Fixed number of shards, of session/connections, that can exist in this cluster. Shards are assigned to nodes.
- Default:
- Mutable: No
nodes: Vec<ConfigNode>
Initial set of nodes that are going be part of this. If not provided, will start a single node cluster.
- Default: [],
- Mutable: No
flush_timeout: u32
Flush timeout on message-queue socket, in seconds. If broker decides to shutdown a connection, because it is broken/half-broken or Malformed packets or due to ProtocolError, a flush thread will take over the connection and flush pending packets upstream and downstream. This timeout shall kick in once the flush thread receives flush-request. All flush activities are expected to be completed before the timeout expires.
- Default: Config::DEF_FLUSH_TIMEOUT
- Mutable: No
pkt_batch_size: u32
Packets are read and written to sockets in batches. This parameter defines the batch size.
- Default: Config::DEF_PKT_BATCH_SIZE
- Mutable: No
publish_retry_interval: u32
Interval between publish retry for QoS-1/2 messages, in seconds.
Implementations§
Source§impl Config
impl Config
Sourcepub const DEF_MAX_NODES: u32 = 1u32
pub const DEF_MAX_NODES: u32 = 1u32
Refer to Config::max_nodes
Sourcepub const DEF_FLUSH_TIMEOUT: u32 = 10u32
pub const DEF_FLUSH_TIMEOUT: u32 = 10u32
Refer to Config::flush_timeout
Sourcepub const DEF_PKT_BATCH_SIZE: u32 = 1_024u32
pub const DEF_PKT_BATCH_SIZE: u32 = 1_024u32
Refer to Config::pkt_batch_size
Sourcepub const DEF_PUBLISH_RETRY_INTERVAL: u32 = 5u32
pub const DEF_PUBLISH_RETRY_INTERVAL: u32 = 5u32
Refer to Config::publish_retry_interval