Larger device-to-cloud telemetry messages lost in IoT Hub

Martti Käärik 20 Reputation points
2023-12-11T12:44:53.2966667+00:00

Hello

We are using Azure IoT Hub via Azure IoT protocol gateway (https://github.com/Azure/azure-iot-protocol-gateway). Device telemetry messages are routed to (1) Azure function apps via Event Grid (IoT Hub built in endpoint) and (2) Azure blob storage.

Everything works fine, except when we try to send larger (195+ kb of message body) device-to-cloud messages. In that case messages never reach the function app but we can see them in the blob storage.

There is no indication of failed deliveries in the IoT Hub and Event Grid metrics. Nothing in App Insights either.

I have 2 questions:

  1. Could it be that IoT Hub measures message size with the meta-data (and not just message body)?
  2. Why don't we see any error or other indication that the delivery has failed?

Any clarifications would be appreciated.

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,120 questions
{count} votes

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 13,461 Reputation points
    2023-12-14T22:07:21.67+00:00

    Hi @Martti Käärik I have looked into this issue further and discovered that the Azure IoT Hub and Event grid can accept larger messages from the devices. The default configuration used by the protocol for MaxInboundMessageSize is set to 256 KB. This is the Maximum message size allowed for publishing from a device to the gateway. If a device publishes a bigger message, the protocol gateway will close the connection.

    This is within the limits of the Max message size supported by IoT Hub and Event Grid through MQTT support. The maximum message sizing limits for IoT Hub and Event grid are 256Kb and 512Kb respectively. So, your message of ~195Kb should not be a concern here.

    Could it be that IoT Hub measures message size with the meta-data (and not just message body)

    To your question, there is some additional metadata send along with the message body such as connection ID, message ID, time stamp which would comprise to the message size in addition to the actual telemetry.

    Based on the trigger you are using in binding your Azure Event grid to Azure function, it might be possible that there is a limitation to the maximum event data size which drives the Azure function to trigger. I could not find any explicit limitation in the documentation around this.

    For a deeper investigation and on this issue, could you please send an email with the below details, so that we can work closely on this matter.

    Thread URL: Link to this thread.

    Azure Subscription ID:

    Email Subject : Attn Leela

    0 comments No comments