MQTT Reconnects May Replay Queued or Retained Messages, Not Just New Events
An MQTT client reconnecting does not always find an empty inbox, since brokers can retain session data and deliver messages queued during an absence. Retained messages may also be delivered to a new subscriber, so a received message doesn't by itself show that a device produced a fresh event. This distinction matters for Home Assistant automations that react to messages after restarts, network drops, or broker maintenance. The article recommends a controlled lab test using a temporary topic, a known publisher and subscriber, and unique payloads to classify whether a delivery was new or replayed. It also notes that such a test does not establish whether a real device or service is healthy.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in