Sending message to Azure IoT hub partition

久未见 提交于 2019-12-24 06:58:22

问题


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


回答1:


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).

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.

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.



来源:https://stackoverflow.com/questions/43076839/sending-message-to-azure-iot-hub-partition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!