High amount of device to Cloud messages, how to limit

I have been testing RuuviTAGs and gateways with Azure IoT Hub and there exists a crucial problem with the amount of messages sent to Azure. At the moment we have 21 tags and 3 gateways running in 3 different locations. Gateway uses MQTT over SSL to send data to Cloud and the amount of messages received by IoT Hub is huge. IoT hub uses 4kB chunks to count messages so messages bigger than that are counted as multiple messages, I’m not sure if this has anything to do with this problem.
Azure has some limits for daily messages and increasing that limit means more costs, e.g. standard tier S1 costs 22€ and has limit of 400k message. S2 costs 220€ and the limit is 6M messages.

Here are some figures:
21 Tags → ~1k messages/minutes → over 1.2M messages/day

Is there any way to adjust:

  1. Sensor advertising interval to e.g. 1/minute or less (the actual need is to get reliable measurement every 5-15 minutes)
  2. Filter out messages at the gateway, reduce amount of messages
  3. Combine multiple tag messages to single gateway to Cloud message.


The RuuviTags send data at a rate of 0.78 Hz by default, so 21 * 60 s * 0.78 Hz = 980 messages per minute sounds right.

The MQTT is meant for high throughput, low latency applications and we let the server side handle the data limiting. This is also why Ruuvi Cloud uses HTTPS, it has a single batch with configurable update interval.

I can think of two approaches here:

  1. Use HTTPS to Azure
  2. Setup your own server as a front-end that receives HTTPS and publishes to Azure with MQTT.

It’s also possible that Azure has some kind of input throttling, but I don’t know if or how that would work.