Hello Sergio Paya Borrull,
Thank you for scoping your use case.
We will try to address 429 rate limit and query on GDPR compliance.
429 rate limit issue
Below command only splits incoming message to 16 routes and does not handle capacity constraints.
az iot hub create --name LIFE-EEG-Hub --sku S1 --partition-count 16
429 rate limits errors comes normally when you exceed your quota limit at some point of operation. Considering you are sending 1200 events or message / second. It might to fail with S1 tier quota.
You should upgrade your IOT hub to S2 or S3 tier to handle this kind of flow and upscale IOT HUB when needed.
Here is the information you requested:
SKU | Messages/day per unit | Max msg/sec (approx) |
---|---|---|
F1 | 8,000 | ~0.1 msg/sec |
F1 | 8,000 | ~0.1 msg/sec |
S1 | 400,000 | ~11.5 msg/sec |
S2 | 6,000,000 | ~173 msg/sec |
S3 | 300,000,000 | ~8,333 msg/sec |
Ref - https://azure.microsoft.com/en-us/pricing/details/iot-hub/
Preprocess in IOT Edge
Yes, we can pre-process the data using IOT edge SDK client before sending to IOT hub. Please check build option and creation option to create modules in IOT Edge. We can also use batching operation to que the message to send in a batch within size limit.
Batching:
We can also use batching operation to que the message to send in a batch with in size limit.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Client;
namespace IoTHubModuleClientSample
{
class Program
{
private static async Task Main(string[] args)
{
string connectionString = "";
var moduleClient = IoTHubModuleClient.CreateFromConnectionString(connectionString);
await moduleClient.OpenAsync();
Console.WriteLine("IoT Hub Module Client connected.");
var telemetryMessages = new List
{
new Message(System.Text.Encoding.ASCII.GetBytes("{\"temperature\": 25.0}")),
new Message(System.Text.Encoding.ASCII.GetBytes("{\"humidity\": 60.0}"))
};
await moduleClient.SendTelemetryBatchAsync(telemetryMessages);
Console.WriteLine("Telemetry batch sent.");
await moduleClient.CloseAsync();
Console.WriteLine("IoT Hub Module Client closed.");
}
}
}
Route to Custom Event HUB:
Here is the process to route telemetry to event hub - Step-by-step:
- In IoT Hub > Message Routing, add a custom route.
- Set endpoint as Event Hub.
- Choose data source as
Device Telemetry
. - Set conditions if needed (e.g., only EEG data).
- Select "Enabled", save.
Ref doc: Understand Azure IoT Hub message routing - Azure IoT Hub | Microsoft Learn
Thank you