question

CloudTexavie-1120 avatar image
0 Votes"
CloudTexavie-1120 asked ·

IOT Hub Message count

Hi,

I am using a free IOT Hub to send device to cloud messages. Each of the messages I send is around 150 bytes in size. Since the message size for the free tier is 0.5KB, I would expect around 3 of the messages I send to account for one. However, the message count is exactly the number of messages I sent. On this example, I sent exactly 270 messages of size around 150 bytes each

77098-image.png



Am I understanding this report correctly ?

azure-iot-hub
image.png (12.3 KiB)
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

asergaz avatar image
1 Vote"
asergaz answered ·

Hi @CloudTexavie-1120 thanks for the great question.

When you send a message to IoT Hub, having 0.1kb or 0.5kb will be count as one message always.

That is why we have this concept in Azure IoT SDKs that batches messages to improve communication efficiency *as well as reduces pricing.

See for example azure iot sdk for .NET device features: https://github.com/Azure/azure-iot-sdk-csharp/tree/master/iothub/device

77231-image.png

Hope I could help you, thanks!

Remember:
- Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.






image.png (140.0 KiB)
· 3 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for clearing this up :) I have used to Microsoft Azure IoT SDK to send my messages, is the batching not turned on by default ?

1 Vote 1 ·

The SDK supports both ways of sending messages, it's up to you to decide what works best for you.

Batching messages reduces the load but can give a delay if you have to collect messages first.

Check out these examples on how to program against the SDK.


2 Votes 2 ·

Got it, thank you!

0 Votes 0 ·