Device-to-cloud messaging

One of the best practices that must be followed in this communication is that although the device might be capturing a lot of information, only data that is of any importance should be transmitted to the cloud. The size of the message is very important in IoT solutions because of the fact that IoT solutions generally have very high volumes of data. Even 1 KB of extra data can result in a gigabyte of storage and processing wasted. Each message has properties and payloads. Properties define the metadata for the message. This metadata contains data about the device, identification, tags, and other properties that are helpful in routing and identifying messages.

Devices or cloud gateways should connect to IoT Hubs to transfer data. IoT Hubs provide public endpoints that can be utilized by devices to connect and send data. IoT Hub should be considered as the first point of contact for backend processing. IoT Hub is capable of further transmission and routing of these messages to multiple services. By default, the messages are stored in event hubs. Multiple event hubs can be created for different kinds of messages:

Messages can be routed to different endpoints based on the message header and body properties, as shown:

Messages in an IoT Hub stay there for seven days by default. Their size can go up to 256 KB.

There is a sample simulator provided by Microsoft for simulating sending messages to cloud. It is available in multiple languages and the C# version is at https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-c2d.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.94.153