问题描述
是否可以通过MQTT直接将消息发布到IoT中心的自定义端点?
is it possible to publish messages via MQTT directly to IoT Hub's custom endpoints?
当前,我将发布到内置端点'devices/{device-id}/messages/events',然后将所有消息路由到我的自定义端点吗?
Currently, I publish to the built-in endpoint ' devices/{device-id}/messages/events ' and then route all messages to my custom endpoint?
直接发布到类似"devices/{device-id}/"azure-storage"/"container" '.
Would be nice to publish directly to something like ' devices/{device-id}/"azure-storage"/"container" '.
此致
Ravi
推荐答案
到自定义端点的路由不是在设备端完成的,而是在IoTHub服务端完成的:
The routing to custom endpoints is not done at the device side but at IoTHub Service side:
" <通过消息路由,可以将遥测数据从您的IoT设备发送到与事件中心兼容的内置终结点或自定义终结点,例如blob存储,服务总线队列,服务总线主题和事件集线器.在配置消息时 路由,您可以创建路由规则以自定义与特定规则匹配的路由.设置完成后,传入的数据会由IoT中心自动路由到端点."
"Message routing enables sending telemetry data from your IoT devices to built-in Event Hub-compatible endpoints or custom endpoints such as blob storage, Service Bus Queue, Service Bus Topic, and Event Hubs. While configuring message routing, you can create routing rules to customize the route that matches a certain rule. Once set up, theincoming data is automatically routed to the endpoints by the IoT Hub."
请阅读本教程以获取更多信息.还要注意,路由独立于所使用的协议,并且消息被路由到不同的端点基于模拟设备附加到邮件的属性.
Please read this tutorial for more information. Also note that the routing is independent from the protocol used and messages are routed to different endpointsbased on properties attached to the message by the simulated device.
谢谢!
=========================================== ===============
==========================================================
如果此答案有帮助,请单击标记为答案"或投票.要提供有关您的论坛体验的其他反馈,请单击 这里
If this answer was helpful, click "Mark as Answer" or Up-Vote. To provide additional feedback on your forum experience, clickhere
这篇关于将MQTT消息直接发布到IoT中心的自定义端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!