将消息发送到Azure IoT中心分区 [英] Sending message to Azure IoT hub partition

查看:84
本文介绍了将消息发送到Azure IoT中心分区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道是否存在一个库,该库可让您使用Azure将消息发送到IoT中心上的特定分区. 以前,我无法通过azuresblite库实现此功能,但是我无法使用它. https://github.com/ppatierno/azuresblite

Does anyone know if there is a library that allows you to send a message to a specific partition on an IoT hub with Azure. I was previously able to achieve this with azuresblite library, unfortunatelly which I Cannot use. https://github.com/ppatierno/azuresblite

推荐答案

无法将消息发送到特定分区.时期. 分区在内部用于允许扩展IoT(事件中心)并允许扩展消费者应用程序(将事件从集线器中读取的应用程序).

There is no way to send a message to a specific partition. Period. Partitions are used internally to allow scaling of the IoT (Event Hub) and allow for scaling out the consumer app (the one that reads the events out of the Hub).

尽管在使用事件中心时可以指定分区密钥,但这确实标识了分区ID.而且,使用IoT中心时,用于指定分区密钥的选项始终处于隐藏状态,您将无法对其进行影响.在事件中心中为邮件指定分区密钥只会确保所有具有相同分区密钥的邮件都属于同一分区.但是您无法确定哪个分区(0,1,2..n).我看到过一些项目,这些项目试图对分区进行文学滥用,并将其用作租户".完全滥用事件中心的可扩展性的错误方法.

While you can specify a Partition Key when using Event Hub, this does identify a Partition ID. And using IoT Hub, the option to specify Partition Key is anyway hidden and you cannot influence it. Specifying a Partition Key for a message in Event Hub will just make sure that all messages with the same partition key will fall into the same partition. But you cannot tell which partition (0,1,2..n). I have seen projects which try to literary abuse the Partitions and use them as "tenants". Very wrong way of completely abusing scalability of Event Hubs.

请不要滥用Event Hub(反正是IoT Hub的后端系统)的分区.请勿强行使用分区键.因此,您将失去事件中心的平衡,并且可能会走错方向.相反,请明确定义您要解决的技术问题,我们可能会为您提供帮助.

Please do not abuse the partitioning of Event Hub (which is anyway the back-end system for an IoT Hub). Do not force Partition Keys. Thus you are unbalancing the Event Hub and may go into a wrong direction. Instead please clearly define a technical issue you are trying to solve and we may be able to help you.

这篇关于将消息发送到Azure IoT中心分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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