简体   繁体   English

使用事件中心从 Android 上的 IoT 中心接收遥测数据。对于 IOT HUB 中的特定设备

[英]Receive telmetry from IoT hub on Android with Event Hub .for particular Device in IOT HUB

On Xamarin Android, I am using Event Hub for receiving data from IoT Hub.在 Xamarin Android 上,我使用事件中心从 IoT 中心接收数据。 How can we receive data from a particular device?我们如何从特定设备接收数据?

For example, if we have device001 and device002 , I want to receive telemetry from IoT hub for only device001 and telemetry from IoT hub for only device002 using Event Hub, or is there any other way?例如,如果我们有device001device002 ,我想从物联网中心接收遥测只device001仅用于遥测从物联网中心device002使用事件中心,或者是有任何其他方式?

Event hubs don't support filtering as for example Service Bus queues or subscriptions.事件中心不支持筛选,例如服务总线队列或订阅。

You can receive all the events of one given partition (using EventHubConsumerGroup.CreateReceiver ).您可以接收一个给定分区的所有事件(使用EventHubConsumerGroup.CreateReceiver )。 Further filtering to device level will have to happen in your code.必须在您的代码中进一步过滤到设备级别。 If you have many devices per partition, you might want to have some intermediate service that filters events before they get to the mobile device (eg a web app with SignalR).如果每个分区有很多设备,您可能需要一些中间服务来在事件到达移动设备之前过滤事件(例如带有 SignalR 的 Web 应用程序)。

You should consider message routing capability of IoT Hub.您应该考虑 IoT 中心的消息路由功能。 There is a good discussion here这是一个很好的讨论在这里

Which leads also to here (good discussion)这也导致这里(很好的讨论)

In any case, you could you Azure Functions to listen and filter messages, route to almost wherever you want.在任何情况下,您都可以使用 Azure Functions 来监听和过滤消息,路由到几乎任何您想要的地方。 Azure Functions are serverless hence low cost coding service. Azure Functions是无服务器的,因此是低成本的编码服务。 It has quick integration capabilities through UI with click click but requires some coding knowledge.它具有通过 UI 和单击单击的快速集成功能,但需要一些编码知识。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM