From ce71a662f977c9dd3790c62620ebd0568276b05f Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 27 Jun 2025 21:45:29 +0100 Subject: Make QoS 2 (ExactlyOnce) the default --- CHANGELOG.md | 4 ++++ README.md | 2 +- src/main.rs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73e40cd..f11ef3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ * The message DUP, QoS, and RETAIN fields as well as the Packet Identifier (when QoS is 1 or 2) are now appended (in that order) to the process arguments. +### Changed + +* The default subscription QoS is now 2 (exactly once) + ### Fixed * Changelog 0.1.0 link now references the tag not an arbitrary diff. diff --git a/README.md b/README.md index 5a58247..7529a82 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ it being ran every time a new MQTT message is published to this topic. ## Missing Features * Configurable timeouts (eventually configurable per process) -* Configurable QoS for each subscription (default is 0 (at most once)) +* Configurable QoS for each subscription (default is 2 (exactly once)) * Configurable logging * Ability to configure programs with non-UTF-8 in paths * Maybe config reloading on SIGHUP diff --git a/src/main.rs b/src/main.rs index bc59b0b..0ba13f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,7 +75,7 @@ async fn main() -> anyhow::Result<()> { let (client, mut event_loop) = conf.mqtt_client(); for topic in conf.routes.keys() { // TODO: Configurable subscription QoS - if let Err(e) = client.subscribe(topic, QoS::AtMostOnce).await { + if let Err(e) = client.subscribe(topic, QoS::ExactlyOnce).await { eprintln!("warning: Failed to subscribe to '{topic}': {e:?}"); } } -- cgit v1.2.3-70-g09d2