Delay of Microsoft.Devices.DeviceConnected (4 to 6 minutes)
Hi
I am working on a system where I use an IotHub (S1 tier) that communicates with one IoT device using the setup showed in the table. Furthermore, I use an EventHub that subscribes on Microsoft.Devices.DeviceConnected and Microsoft.Devices.DeviceDisconnected events and forwards them to the backend.
According to your documentation on device connection state interval it can take up to 1 minute for an connection state event to be raised.
I have observed that the Microsoft.Devices.DeviceConnected event has been delayed up to 6 minutes after a connection have been established between a device and the IotHub. It is important to note that I have not observed a delayed Microsoft.Devices.DeviceDisconnected event.
This is shown on Delay of Connection Events below where 75% of the connect events had a delay above four minutes, and 0% of the disconnect events were delayed.
It has also been observed that a connection between IoTHub and DeviceClient is established and after four to six minutes the connection state event is delivered to the EventHub and forwarded to the backend, as shown on Communication from IotHub to EventHub. The graph shows two delayed signals in red squares compared to the first incoming message.
Note that a message should be received by the EventHub within a minute each time a device change connection status. This is the case when the number of connected devices goes from 1 to 0 (a device becomes offline), and is not the case when the number of connected devices goes from 0 to 1 (a device becomes online).
Do you have an idea of where this delay has root, and how I can mitigate this problem?