RidgeRun Metadata/Metadata Integration with Messaging Systems/MQTT

From RidgeRun Developer Wiki

Follow Us On Twitter LinkedIn Email Share this page





NVIDIA partner logo NXP partner logo





Message Queuing Telemetry Transport (MQTT)

Introduction

MQTT is a lightweight messaging protocol based on the publish/subscribe model, designed for networks with constrained resources, high latency, or unreliable connections. Originally developed by IBM in 1999, MQTT is widely used in Internet of Things (IoT) applications where efficient, low-overhead communication is essential between sensors, devices, and backend services.

Key Features

  • Publish/Subscribe model:
    • Clients can publish messages to specific topics.
    • Other clients can subscribe to those topics to receive messages asynchronously.
  • Low bandwidth usage:
    • Extremely lightweight, making it ideal for embedded systems and mobile networks.
  • Quality of Service (QoS) levels:
    • QoS 0 – At most once (no acknowledgment).
    • QoS 1 – At least once (requires acknowledgment).
    • QoS 2 – Exactly once (with handshake mechanism).
  • Runs over TCP/IP:
    • Ensures reliable delivery through an established TCP connection.
  • Advanced messaging features:
    • Retained messages: Broker stores the last message on a topic.
    • Last Will and Testament (LWT): A final message sent by the broker if a client disconnects unexpectedly.

MQTT is particularly well-suited for scenarios where bandwidth is limited or costly, and where devices operate under intermittent or unstable connectivity conditions. Its lightweight nature enables reliable message delivery without introducing significant overhead, making it ideal for constrained environments. Additionally, MQTT is highly scalable and can support communication across thousands or even millions of devices, which is essential for modern distributed systems.

Typical use cases include IoT sensor telemetry—such as temperature, GPS, and pressure readings—remote monitoring of field devices like drones, robots, and security cameras, and smart home applications involving lighting, alarms, or automation. MQTT is also increasingly used for the transmission of extracted video metadata, such as SEI-encoded information, to dashboards or automated systems that require real-time contextual data.

Example

Case

Build metadata code

References

https://mqtt.org/

https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html

https://www.hivemq.com/mqtt-essentials/

https://mosquitto.org/