Home > Back-end >  How to limit a number of messages recieved by a device on Azure IoTHUB
How to limit a number of messages recieved by a device on Azure IoTHUB

Time:11-23

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?

CodePudding user response:

I don't think it's possible. The closest would be using Azure Stream Analytics and some windowing function to get the latest of first message in a 1 minute interval

CodePudding user response:

Curious to understand the use case, the message rate is always controlled at the device end and not the service as it is in control of the rate. Opening a connection and spamming the service is odd pattern. IoT Hub and any similar public service will always throttle to prevent abuse at the service level not device. Designing ingestion service that can hold 1 million concurrent connections with per device throttling is tall order at the price point.

  • Related