Skip to content

Commit 855307c

Browse files
Merge pull request #229184 from kgremban/mar1-105808
Clarify short expiry time pattern
2 parents d8a950d + f9dc02e commit 855307c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

articles/iot-hub/monitor-device-connection-state.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
title: Monitor device status - Azure IoT Hub
3-
description: Use Event Grid or heartbeat patterns to monitor IoT Hub device connection states.
2+
title: Monitor device status
3+
titleSuffix: Azure IoT Hub
4+
description: Use Event Grid or the device heartbeat pattern to monitor the connection states of Azure IoT Hub devices.
45
author: kgremban
56
ms.author: kgremban
67
ms.topic: reference
@@ -68,17 +69,20 @@ Using Event Grid to monitor your device status comes with the following limitati
6869

6970
If any of these limitations affect your ability to use Event Grid for device status monitoring, then you should consider building a custom device heartbeat pattern instead.
7071

71-
## Device heartbeat
72+
## Device heartbeat pattern
7273

7374
If you need to know the connection state of your devices but the limitations of Event Grid are too restricting for your solution, you can implement the *heartbeat pattern*. In the heartbeat pattern, the device sends device-to-cloud messages at least once every fixed amount of time (for example, at least once every hour). Even if a device doesn't have any data to send, it still sends an empty device-to-cloud message, usually with a property that identifies it as a heartbeat message. On the service side, the solution maintains a map with the last heartbeat received for each device. If the solution doesn't receive a heartbeat message within the expected time from the device, it assumes that there's a problem with the device.
7475

75-
> [!NOTE]
76-
> If an IoT solution uses the connection state solely to determine whether to send cloud-to-device messages, and messages are not broadcast to large sets of devices, consider using the simpler *short expiry time* pattern. This pattern achieves the same result as maintaining a device connection state registry using the heartbeat pattern, while being more efficient. If you request message acknowledgements, IoT Hub can notify you about which devices are able to receive messages and which are not.
77-
7876
### Device heartbeat limitations
7977

8078
Since heartbeat messages are implemented as device-to-cloud messages, they count against your [IoT Hub message quota and throttling limits](iot-hub-devguide-quotas-throttling.md).
8179

80+
### Short expiry time pattern
81+
82+
If an IoT solution uses the connection state solely to determine whether to send cloud-to-device messages to a device, and messages aren't broadcast to large sets of devices, consider using the *short expiry time pattern* as a simpler alternative to the heartbeat pattern. The short expiry time pattern is a way to determine whether to send cloud-to-device messages by sending messages with a short message expiration time and requesting message acknowledgments from the devices.
83+
84+
For more information, see [Message expiration (time to live)](./iot-hub-devguide-messages-c2d.md#message-expiration-time-to-live).
85+
8286
## Other monitoring options
8387

8488
A more complex implementation could include the information from [Azure Monitor](../azure-monitor/index.yml) and [Azure Resource Health](../service-health/resource-health-overview.md) to identify devices that are trying to connect or communicate but failing. Azure Monitor dashboards are helpful for seeing the aggregate health of your devices, while Event Grid and heartbeat patterns make it easier to respond to individual device outages.

0 commit comments

Comments
 (0)