Skip to content

Commit 25cd30a

Browse files
authored
Update iot-hub-event-grid.md
Adding details in the doc around device connection/disconnect events.
1 parent b21ee6a commit 25cd30a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

articles/iot-hub/iot-hub-event-grid.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,13 @@ To receive device connected and device disconnected events, you must open the D2
183183

184184
The D2C link is open if you are sending telemetry.
185185

186-
If the device connection is flickering, which mean the device connects and disconnects frequently, we will not send every single connection state, but will publish the *last* connection state, which is eventually consistent. For example, if your device has been in the connected state initially, then connectivity flickers for a few seconds, and then it's back in connected state. No new device connection state events will be published since the initial connection state.
186+
## Limitations for device connected and device disconnected events
187+
188+
To receive device connection state events, a device must do either a ‘D2C Send Telemetry’ OR a ‘C2D Receive Message’ operation with Iot Hub. However, note that if a device is using AMQP protocol to connect with Iot Hub, it is recommended that they do a ‘C2D Receive Message’ operation otherwise their connection state notifications may be delayed by few minutes. If your device is using MQTT protocol, IoT Hub will keep the C2D link open. For AMQP, you can open the C2D link by calling the [Receive Async API](https://docs.microsoft.com/dotnet/api/microsoft.azure.devices.client.deviceclient.receiveasync?view=azure-dotnet), for IoT Hub C# SDK, or [device client for AMQP] (https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-amqp-support#device-client).
189+
190+
The D2C link is open if you are sending telemetry.
187191

188-
In case of an IoT Hub outage, we will publish the device connection state as soon as the outage is over. If the device disconnects during that outage, the device disconnected event will be published within 10 minutes.
192+
If the device connection is flickering, which means the device connects and disconnects frequently, we will not send every single connection state, but will publish the current connection state taken at a periodic snapshot, till the flickering continues. Receiving either the same connection state event with different sequence numbers or different connection state events both mean that there was a change in the device connection state.
189193

190194
## Tips for consuming events
191195

0 commit comments

Comments
 (0)