How to limit a number of messages recieved by a device on Azure IoTHUB

Justin Oberle 21 Reputation points
2022-11-22T15:31:17.787+00:00

I need to limit a device to 1 message every 60 seconds and I do not know how to do this. I can limit the entry in the DB but I am not sure how to prevent throttling on the IoTHub. I am concerned that a device might accidentally spam IoTHub if the wrong interval to send data is entered, like say maybe 0.006 milliseconds instead of 60000. I would like to block all messages from the same device, or kick the device, if it tries to send more than 1 message within some time threshold. I couldn't find any good documentation on this. Is this possible?

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

Accepted answer
  1. chbeier 1,866 Reputation points
    2022-11-22T15:47:06.557+00:00

    Hi @Justin Oberle ,
    IoT Hub has no build in "per device" throttling or configurable throttling. Thus, you need to build your custom solution to block devices in IoT Hub or prevent them sending more messages than intended. this can be either done via custom logic in the cloud observing the number of messages per device and controlling the device's status "enabled/disabled" in the device registry or within the device's client code by maintaining a message counter and deactivate sending within a specific time.

    Please see also a previous question iot-hub-limitation-of-the-number-of-messages-sent.html

    ----------

    If your issue was solved, please hit "accept answer" and feel free to vote for the post. This will help others with the same questions. Thanks

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful