Azure IoTHub DeviceMessage结构和路由查询 [英] Azure IoTHub DeviceMessage structure and route query

查看:87
本文介绍了Azure IoTHub DeviceMessage结构和路由查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了 https中的python示例://docs.microsoft.com/de-de/azure/iot-hub/quickstart-send-telemetry-python 将遥测数据发送到IoTHub.现在,我尝试仅通过自定义终结点和路由将消息从设备"test-device"转发到Blob存储中.使用查询字符串"true",来自所有设备的所有消息均被推送到存储中.但是,我没有获得查询以仅从deviceId"test-device"中选择消息.我在文档中进行搜索,但是没有找到任何有用的示例...

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 messages from the device "test-device" into a blob storage via a custom endpoint and a route. With the query string "true" all messages from all devices are pushed to the storage. However, I don't get the query to select only the messages from the deviceId "test-device". I search in the documentation but didn't find any helpful example...

有人可以帮助我进行查询吗?至少对IoTHub中的传入消息进行采样以了解IotHub消息的结构也很有帮助(就像在StreamAnalytics采样数据"中所做的一样).

Can anyone help me with the query? At least it would be also helpful to sample incoming messages inside the IoTHub to get an idea of the structure of IotHub messages (like it is done in the StreamAnalytics "sample data").

推荐答案

您可以尝试在路由查询中使用 $ connectionDeviceId ="{您的设备ID}" .IoT中心将 connectionDeviceId 标记在服务绑定消息上.我认为这比沉默的建议更简单.消息系统属性以"$"符号为前缀.用于消息路由的更多查询语言

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.

这篇关于Azure IoTHub DeviceMessage结构和路由查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆