Azure Iothub Devicemessage Structure And Route Query
I used the python example from https://docs.microsoft.com/de-de/azure/iot-hub/quickstart-send-telemetry-python to send telemetry data to the IoTHub. Now I try to forward only the m
Solution 1:
You can try to use $connectionDeviceId = "{your device id}"
in the route query. connectionDeviceId
is stamped on servicebound messages by the IoT Hub. I think it is simpler than silent's suggestion. Message system properties are prefixed with the '$' symbol. More query language for message routing here.
Solution 2:
There is a very good blog post on message routing here.
You can for example route on any properties you add to your messages or on any field inside your message body (if it is UTF-8 encoded JSON). Not sure if you can by default route on deviceId, but you could for example add a property "testmessage": true
to your messages and then have a routing rule to match that:
"testmessage" = true
Post a Comment for "Azure Iothub Devicemessage Structure And Route Query"