Glossary Updates12 new terms added to the glossaries · October 2, 2026, 22:44 CEST
AI TechDocKnowledge

Glossary · Industrial communication

Retained message (MQTT)

Also known as: Retained message, Retain flag

German: Retained Message (MQTT)

In MQTT, a retained message is a message published with the retain flag set, which the broker stores as the last known value of its topic and delivers immediately to every client that subscribes to a matching topic later.

  • Industrial communication
  • Standards

In one sentence

A retained MQTT message is stored by the broker as the topic's last value and sent at once to every client that subscribes later.

Example

A filler publishes its machine state as a retained message, so a dashboard that starts during a shift shows Running immediately instead of waiting for the next state change.

How it applies

  • Design: Retain suits state values (machine state, configuration, online status); it doesn't suit events or counters of individual occurrences, since a new subscriber would take an old event for a new one.
  • Operations: The broker keeps one retained message per topic. It is removed by publishing an empty retained message to that topic, which is needed when a machine or data point is decommissioned; otherwise the stale value stays.
  • Integration: A retained value may be old. Payloads should carry a timestamp so consumers can tell a current state from one left behind by a device that is offline. MQTT 5.0 lets subscribers choose whether they get retained messages at all (retain handling).
  • Documentation: The documentation team documents which topics are retained, what the retained value means and how to clear it.

Retained message vs. persistent session

A retained message is stored per topic for any future subscriber. A Persistent session (MQTT) stores messages for one client that was offline.

By knowledge.aitechdoc.world · Published September 28, 2026 · Last reviewed

Source: OASIS, MQTT Version 5.0, section 3.3.1.3 RETAIN

Definitions follow the cited standards and specifications. Where a source is a copyrighted publication, such as an ISO, IEC or EN standard, the definition is a close paraphrase, not a verbatim quotation, so as not to infringe copyright. We recommend reading the original publication. The sections “How it applies” are editorial commentary by AI TechDoc Blog and are not part of any standard.

Seen a mistake? Send us a note!