grafana / mqtt-datasource

MQTT Datasource for Grafana allows streaming data from any MQTT broker running either locally or remotely.
Apache License 2.0
172 stars 51 forks source link

fix: reuse session to receive data from subscriptions after reconnect #98

Open Maddin-619 opened 5 months ago

Maddin-619 commented 5 months ago

In case of a mqtt reconnect event with the current configuration the subscriptions will not be recreated after the auto reconnect. As a result, the panels no longer receive any data. Refreshing the browser doesn't help.

There are to ways to fix that:

  1. We need to set all topic states to unsubscribed in case of a disconnect and recreate the subscriptions after a successful reconnect.
  2. Set the clean session config to false. Than the broker will reactivate all subscriptions for that client id automatically and will publish data right after reconnecting. (my suggestion)
CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.