From 9efe7c12f0a30be2e1475dd71bfe8e4dddb389df Mon Sep 17 00:00:00 2001 From: Rodney Gitzel Date: Wed, 3 Oct 2018 17:21:30 -0700 Subject: [PATCH] Expand documentation of 'qos' configuration in mqtt_consumer input (#4784) --- etc/telegraf.conf | 9 ++++++++- plugins/inputs/mqtt_consumer/README.md | 10 +++++++++- plugins/inputs/mqtt_consumer/mqtt_consumer.go | 9 ++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/etc/telegraf.conf b/etc/telegraf.conf index d81e1b993..0a1607281 100644 --- a/etc/telegraf.conf +++ b/etc/telegraf.conf @@ -3918,8 +3918,15 @@ # ## schema can be tcp, ssl, or ws. # servers = ["tcp://localhost:1883"] # -# ## MQTT QoS, must be 0, 1, or 2 +# ## QoS policy for messages +# ## 0 = at most once +# ## 1 = at least once +# ## 2 = exactly once +# ## +# ## When using a QoS of 1 or 2, you should enable persistent_session to allow +# ## resuming unacknowledged messages. # qos = 0 +# # ## Connection timeout for initial connection in seconds # connection_timeout = "30s" # diff --git a/plugins/inputs/mqtt_consumer/README.md b/plugins/inputs/mqtt_consumer/README.md index df7869a86..0ec668c40 100644 --- a/plugins/inputs/mqtt_consumer/README.md +++ b/plugins/inputs/mqtt_consumer/README.md @@ -13,8 +13,16 @@ The plugin expects messages in the ## MQTT broker URLs to be used. The format should be scheme://host:port, ## schema can be tcp, ssl, or ws. servers = ["tcp://localhost:1883"] - ## MQTT QoS, must be 0, 1, or 2 + + ## QoS policy for messages + ## 0 = at most once + ## 1 = at least once + ## 2 = exactly once + ## + ## When using a QoS of 1 or 2, you should enable persistent_session to allow + ## resuming unacknowledged messages. qos = 0 + ## Connection timeout for initial connection in seconds connection_timeout = "30s" diff --git a/plugins/inputs/mqtt_consumer/mqtt_consumer.go b/plugins/inputs/mqtt_consumer/mqtt_consumer.go index 58074af79..5853ad939 100644 --- a/plugins/inputs/mqtt_consumer/mqtt_consumer.go +++ b/plugins/inputs/mqtt_consumer/mqtt_consumer.go @@ -53,8 +53,15 @@ var sampleConfig = ` ## schema can be tcp, ssl, or ws. servers = ["tcp://localhost:1883"] - ## MQTT QoS, must be 0, 1, or 2 + ## QoS policy for messages + ## 0 = at most once + ## 1 = at least once + ## 2 = exactly once + ## + ## When using a QoS of 1 or 2, you should enable persistent_session to allow + ## resuming unacknowledged messages. qos = 0 + ## Connection timeout for initial connection in seconds connection_timeout = "30s"