How MQTT Works?
MQTT (Message Queuing Telemetry Transport) is a lightweight protocol where clients can publish and subscribe to messages. MQTT protocol is designed for constrained devices that operate with low-bandwidth.
Here are some of the basic MQTT concepts,
- MQTT Publish
- MQTT Subscribe
- MQTT Messages
- MQTT Broker
Devices can publish messages periodically. For example, a device can publish its temperature sensor readings periodically. In the above illustrated example, Device 1 is publishing messages under the topic /dev1/topic1 and Device 2 is publishing messages under topic /dev2/topic1.
Devices can subscribe to messages from other devices. In the above illustrated example, Device 1 is subscribed to messages from Device 2 for the topic /dev2/topic1 and Device 2 is is subscribed to messages from Device 1 for the topic /dev1/topic1
Devices publish messages under a topic name. Devices can publish messages under different topics.
MQTT messages are the actual information that the device publishes.
MQTT Broker is the intermediary that is responsible for receiving all the messages published by the clients (devices), filtering the messages and sending the messages to the subscribed clients.
Module , M2M , GPRS , 3G , through AT commands,