Hello @TITAN ,
the Azure IoT Hub supports routing messages to one or more endpoints.
You can add a condition so based on either message properties or the message body.
The properties (both system properties and application properties) are key/value pairs in property bags so these are easy to process for the IoT Hub.
The body is not that simple though.
The body arrives as a byte array and needs to be 'decoded' first.
Microsoft has decided to support only body messages written in JSON and encoded in UTF-8.
You have to add this to each message sent.
If you are using one of the Azure IoT Device SDKs, the class properties are available for you:
using (var message = new Message(messageBytes))
{
message.ContentEncoding = "utf-8";
message.ContentType = "application/json";
await deviceClient.SendEventAsync(message);
}
As far as I know, this is also supported for non-SDK device connectivity solutions.
If you fail to add these, your route will not be triggered.
Personally, I would limit IoT Hub routing to no-functional routing because there is a limit to the number of routes and endpoints offered. I recommend using a Stream Analytics job to actually filter/route messages based on business rules.
----------
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. By doing so, all community members who have a similar issue will benefit. Your contribution is highly appreciated.