pub struct Config {Show 13 fields
pub mqtt_listener: bool,
pub mqtt_port: u16,
pub mqtt_max_packet_size: u32,
pub mqtt_sock_read_timeout: Option<u32>,
pub mqtt_sock_write_timeout: Option<u32>,
pub mqtt_connect_timeout: u32,
pub mqtt_keep_alive: Option<u16>,
pub mqtt_keep_alive_factor: F32,
pub mqtt_session_expiry_interval: Option<u32>,
pub mqtt_maximum_qos: u8,
pub mqtt_receive_maximum: u16,
pub mqtt_retain_available: bool,
pub mqtt_topic_alias_max: Option<u16>,
}
Expand description
Configuration for MQTT-V5 protocol.
Fields§
§mqtt_listener: bool
Spawn MQTT listener, listening on Config::mqtt_port.
mqtt_port: u16
MQTT network port for each node in this cluster. Once the cluster is spawned it will listen on all the available interfaces using this port.
- Default: “0.0.0.0:1883”, Refer to Config::DEF_MQTT_PORT
- Mutable: No
mqtt_max_packet_size: u32
Maximum packet size allowed by the broker, this shall be communicated with remote client during handshake.
- Default: Config::DEF_MQTT_MAX_PACKET_SIZE
- Mutable: No
mqtt_sock_read_timeout: Option<u32>
Read timeout on MQTT socket, in seconds. For every new packet this timeout will kick in, and within the timeout period if a new packet is not completely read, connection will be closed.
- Default: None,
- Mutable: No
mqtt_sock_write_timeout: Option<u32>
Write timeout on MQTT socket, in seconds. For every new packet this timeout will kick in, and within the timeout period if a new packet is not completely written, connection will be closed.
- Default: None,
- Mutable: No
mqtt_connect_timeout: u32
Connect handshake timeout on MQTT socket, in seconds. For every new connection, this timer will kick in, and within the timeout period if connect/ack handshake is not complete, connection will be closed.
- Default: Config::DEF_MQTT_CONNECT_TIMEOUT
- Mutable: No
mqtt_keep_alive: Option<u16>
Keep Alive, in secs, that broker can suggest to the client. If configured with non-zero value, clients should use this keep-alive instead of the client configured keep-alive-timeout.
- Default: None,
- Mutable: No
mqtt_keep_alive_factor: F32
Keep Alive factor, the final value of mqtt_keep_alive
is computed by
multiplying the mqtt_keep_alive
value with this factor.
- Default: Config::DEF_KEEP_ALIVE_FACTOR
- Mutable: No
mqtt_session_expiry_interval: Option<u32>
MQTT session_expiry_interval
on the broker side. If session_expiry_interval
is ZERO or None, then session_expiry_interval
from CONNECT packet is used.
CONNECT has no session_expiry_interval
interval or it is ZERO, then session
ends immediately at connection close.
- Default: None,
- Mutable: No
mqtt_maximum_qos: u8
MQTT mqtt_maximum_qos
on the broker side. This is the advertised maximum
supported QoS level by the broker.
- Default: Config::DEF_MQTT_MAX_QOS
- Mutable: No
mqtt_receive_maximum: u16
MQTT Receive-maximum, control the number of unacknowledged PUBLISH packets server can receive and process concurrently for the client.
- Default: Config::DEF_MQTT_RECEIVE_MAXIMUM
- Mutable: No
mqtt_retain_available: bool
MQTT retain available and supported by broker. Disabling this would disable retain-messages on the borker side.
- Default: Config::DEF_MQTT_RETAIN_AVAILABLE
- Mutable: No
mqtt_topic_alias_max: Option<u16>
MQTT Maximum value for topic_alias allowed. Specifying a value of N would mean broker can handle N-1 aliases for topic-name. Setting this value to ZERO is same as specifying None, that is, broker won’t accept any topic-aliases.
- Default: Config::DEF_MQTT_TOPIC_ALIAS_MAX
- Mutable: No
Implementations§
Source§impl Config
impl Config
Sourcepub const DEF_MQTT_LISTENER: bool = true
pub const DEF_MQTT_LISTENER: bool = true
Refer to Config::mqtt_listener
Sourcepub const DEF_MQTT_PORT: u16 = 1_883u16
pub const DEF_MQTT_PORT: u16 = 1_883u16
Refer to Config::mqtt_port
Sourcepub const DEF_MQTT_MAX_PACKET_SIZE: u32 = 1_048_576u32
pub const DEF_MQTT_MAX_PACKET_SIZE: u32 = 1_048_576u32
Refer to Config::mqtt_max_packet_size
Sourcepub const DEF_MQTT_CONNECT_TIMEOUT: u32 = 5u32
pub const DEF_MQTT_CONNECT_TIMEOUT: u32 = 5u32
Refer to Config::mqtt_connect_timeout
Sourcepub const DEF_KEEP_ALIVE_FACTOR: f32 = 1.5f32
pub const DEF_KEEP_ALIVE_FACTOR: f32 = 1.5f32
Refer to Config::keep_alive_factor
Sourcepub const DEF_MQTT_MAX_QOS: u8 = 1u8
pub const DEF_MQTT_MAX_QOS: u8 = 1u8
Refer to Config::mqtt_maximum_qos
Sourcepub const DEF_MQTT_RECEIVE_MAXIMUM: u16 = 256u16
pub const DEF_MQTT_RECEIVE_MAXIMUM: u16 = 256u16
Refer to Config::mqtt_receive_maximum
Sourcepub const DEF_MQTT_RETAIN_AVAILABLE: bool = true
pub const DEF_MQTT_RETAIN_AVAILABLE: bool = true
Refer to Config::mqtt_retain_available
Sourcepub const DEF_MQTT_TOPIC_ALIAS_MAX: u16 = 65_535u16
pub const DEF_MQTT_TOPIC_ALIAS_MAX: u16 = 65_535u16
Refer to Config::mqtt_topic_alias_max