Practice MQTT protocol vocabulary: broker, topic hierarchy, QoS levels, retained messages, last will and testament, and MQTT over WebSocket language.
0 / 5 completed
1 / 5
In MQTT, what is the role of the 'broker'?
The MQTT broker is the intermediary: publishers send messages to the broker, and the broker routes them to all clients subscribed to the matching topic. The broker decouples producers and consumers in IoT architectures. Common brokers: Mosquitto, HiveMQ, AWS IoT Core.
2 / 5
In the topic 'home/sensor/temperature', what does the hierarchy represent?
MQTT topic hierarchies use '/' as a separator. Subscribers can use wildcards: 'home/+/temperature' subscribes to temperature from any sensor, and 'home/#' subscribes to everything under 'home'. Well-designed topic hierarchies make large IoT deployments manageable.
3 / 5
What does MQTT QoS level 2 guarantee?
MQTT QoS levels: 0 = at most once (fastest, no guarantee); 1 = at least once (duplicates possible); 2 = exactly once (four-step handshake ensures the message arrives exactly once). QoS 2 is used for commands where duplicates would cause problems (e.g., unlocking a door twice).
4 / 5
What is a 'retained message' in MQTT?
A retained message is the 'last known good' value for a topic. When a new device subscribes to 'home/sensor/temperature', it immediately receives the last retained value without waiting for the next publish event — critical for IoT state initialisation.
5 / 5
What is the 'Last Will and Testament' (LWT) feature in MQTT?
LWT lets a device pre-register a 'I went offline' message with the broker. If the device disconnects without sending a proper DISCONNECT packet (e.g., power failure), the broker publishes the LWT to the specified topic — enabling real-time offline detection in IoT fleets.