Skip to content

Commit

Permalink
fix: unset clean_session
Browse files Browse the repository at this point in the history
NOTE: This ensures that no data is lost as a result of inflight being unacknowledged during a network failure/restart
  • Loading branch information
de-sh committed Oct 22, 2024
1 parent d224cea commit 0ee76a3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions uplink/src/base/mqtt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ fn mqttoptions(config: &Config, device_config: &DeviceConfig) -> MqttOptions {
mqttoptions.set_max_packet_size(config.mqtt.max_packet_size, config.mqtt.max_packet_size);
mqttoptions.set_keep_alive(Duration::from_secs(config.mqtt.keep_alive));
mqttoptions.set_inflight(config.mqtt.max_inflight);
mqttoptions.set_clean_session(false);

if let Some(auth) = device_config.authentication.clone() {
let ca = auth.ca_certificate.into_bytes();
Expand Down

0 comments on commit 0ee76a3

Please sign in to comment.