A device using MQTT is subscribed to cloud-to-device (C2D) messages and goes offline. What happens to the C2D messages sent to this device while it is offline?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: IoT Hub stores the messages in a queue up to the configured Time-To-Live (TTL) limit and delivers them when the device reconnects

IoT Hub maintains a C2D queue for each registered device. When a device is offline, messages sent to it are stored in the queue. They remain there until the message's Time-To-Live ...

๐Ÿ“‹Part of Microsoft Certified: Azure IoT Developer Specialty (AZ-220) ยท Azure Certification Practice
Real Exam ScenarioAzure IoT Hub

A device using MQTT is subscribed to cloud-to-device (C2D) messages and goes offline. What happens to the C2D messages sent to this device while it is offline?

โœ“ Correct Answer & ExplanationAzure IoT Hub

Correct Answer

IoT Hub stores the messages in a queue up to the configured Time-To-Live (TTL) limit and delivers them when the device reconnects

Why This Answer Is Correct

IoT Hub maintains a C2D queue for each registered device. When a device is offline, messages sent to it are stored in the queue. They remain there until the message's Time-To-Live (TTL) expires (default is 1 hour, configurable up to 48 hours), or until the device reconnects and retrieves them.

๐Ÿ“š What This Question Tests

This question evaluates your knowledge of Azure IoT Hub โ€” a core concept tested in Microsoft Certified: Azure IoT Developer Specialty (AZ-220). Understanding Azure IoT Hub is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.