In a publish-subscribe architecture, what is the main role of the broker?
Think about how messages flow from senders to receivers without direct connection.
The broker acts as a middleman that receives messages from publishers and forwards them to subscribers who have expressed interest in specific topics.
What is the expected output when a client successfully subscribes to the topic home/temperature using the MQTT command below?
mosquitto_sub -t home/temperature
Consider what happens immediately after subscribing before any messages arrive.
The subscribe command waits silently for messages; it does not print confirmation unless a message arrives.
Arrange the steps below in the correct order to set up a basic publish-subscribe communication using MQTT.
The broker must be running before clients connect; subscribers listen before messages are sent.
First, start the broker. Then subscribe to the topic so the client is ready to receive. Next, publish the message. Finally, the subscriber receives it.
A subscriber client connected to the MQTT broker subscribes to sensor/data but never receives messages. Which is the most likely cause?
Check if the topic names match exactly between publisher and subscriber.
If the publisher sends messages to a different topic, the subscriber won't receive them because subscriptions are topic-specific.
In a publish-subscribe system for critical IoT sensor data, which MQTT QoS level ensures messages are delivered exactly once without duplicates?
Consider the QoS levels defined by MQTT and their delivery guarantees.
QoS 2 ensures messages are delivered exactly once, preventing duplicates, which is critical for reliable IoT data.