Guide to MQTT

An introductory guide to MQTT – the most used IoT messaging protocol

What is MQTT?

MQTT (Message Queuing Telemetry Transport) is a communication protocol for the Internet of Things (IoT) that uses the publish/subscribe method for communication. MQTT  is lightweight and is used in low bandwidth environments. 

The three main roles in MQTT are the Producer, the Broker, and the Consumer. The producer publishes a message to the Broker. The Broker sends the message to the appropriate consumer(s) that are subscribed to the specific topics.

An illustration of MQTT

Benefits of MQTT

MQTT Brokers

An MQTT broker is responsible for sending messages from the producer to the consumer.  The broker also queues messages for MQTT clients that are subscribed to various topics and sends specific messages to appropriate clients. 

When starting with MQTT, it is important to start with a reliable and trusted MQTT broker. The Eclipse Mosquitto MQTT broker is the most popular MQTT broker in the world. It is written in C language which makes it extremely fast. Mosquitto is available in both open source and premium versions. 

Mosquitto logo for Cedalo real-time platform
Mosquitto logo for Cedalo real-time platform

MQTT Clients

Another relevant concept to take note of when getting started with MQTT is the MQTT clients. The role of an MQTT client is simply to publish a message to a topic to an MQTT broker. Other clients can subscribe to the broker and consequently subscribe to the specific topics. Clients can publish and subscribe to data. You can find a list of MQTT clients comparisons here.  

Screenshot of the Management Center for Eclipse Mosquitto

Get Started with Mosquitto

Cedalo is the sponsor of Eclipse Mosquitto which is open source. However, Cedalo built on the open source core to provide the Cedalo Enterprise Platform for Eclipse Mosquitto.  Cedalo also provides the Cedalo Management Center for Eclipse Mosquitto which gives a graphical representation of your MQTT brokers. 

MQTT Resources

An Introduction to JSON and MQTT with Roger Light

Roger Light sits down with Kristian Raue to present a simple introduction to JSON and MQTT and how these two standards work together in IoT and Stream Processing.

Webinar: An In-depth Overview of Mosquitto 2.0

In this Mosquitto 2.0 webinar, Roger Light, the project lead and primary developer of Eclipse Mosquitto, takes us through the features and capabilities of Mosquitto 2.0. 

Connecting Streamsheets to Industrial Machinery via MQTT

Learn how to control an industrial machinery that sorts incoming parts according to their color and shape using Streamsheets and MQTT.