MQTT#

MQTT: From producer to consumer#
LEAF uses MQTT for transmitting data from a device (a publisher) and for receiving the transmission on another device (a subscriber). Designed for Internet of Things (IoT), especially for IoT devices that have limited amount of resources and their associated networks which may have low bandwidth. MQTT utilises a publish and subcribe model: the publisher commits a message to a particular topic, which the broker routes to any subscribers. As publisher and subscriber clients only interact with a broker the publishers and subscribers are decoupled from one another, a publisher doesn’t know anything programmatically about the subscriber and likewise a subscriber knows nothing about the publisher. Although a client can be both a publisher and a subscriber. The broker can include a number of reliability measures such a message retention and Quality of Service (QoS) features.
MQTT Component#
MQTT has the following components:
Broker. A server which receives and send messages to subscribers. An intermediary between Publisher and Subscriber clients.
Publisher. A Client which publishes message to MQTT Broker with a particular topic.
Subscriber. The Client which receives message from the broker on subscription of particular topic. A client can be both publisher and subscriber.
Topic. The virtual channel in which Publisher and Subscriber send and receive message(s).