[英]How to receive messages from event hub and forward to android application using Azure Notification Hubs?
I want to receive messages from an event hub in .net and sending them to my android application (with notification hub). 我想从.net中的事件中心接收消息,并将其发送到我的android应用程序(带有通知中心)。
At the moment, I receive the messages from the event hub using Event processor . 目前,我使用事件处理器从事件中心接收消息 。
Now I want to forward them to my android application. 现在,我想将它们转发到我的android应用程序。 What is the best way to complete this?
完成此操作的最佳方法是什么?
You're asking a very generic question, so I'm giving a very generic answer. 您在问一个非常普通的问题,所以我给一个非常普通的答案。 If you'd like more information, please provide more details.
如果您需要更多信息,请提供更多详细信息。
The general model would probably be something like this: 通用模型可能是这样的:
I'd recommend linking your Event Hub with Notification Hubs via an Azure Function. 我建议通过Azure函数将事件中心与通知中心链接。
Step 1: Your Android device must register with the FCM to get a device token and then register the device with Notification Hubs. 步骤1:您的Android设备必须在FCM中注册以获得设备令牌,然后在Notification Hubs中注册该设备。 Since we are going to be dealing with Azure Functions, which is based on App Service, you can use App Service Push for this functionality - this will require a "HTTP POST" to the endpoint.
由于我们将要处理基于App Service的Azure Functions,因此您可以使用App Service Push来实现此功能-这将需要对端点的“ HTTP POST”。 See http://aka.ms/zumobook Chapter 5 for a Xamarin implementation of this.
有关此的Xamarin实现,请参见http://aka.ms/zumobook第5章。
Step 2: Create an Azure Function to link the event hub, do whatever processing you need and submit a push notification to the Notification Hub. 步骤2:创建一个Azure函数来链接事件中心,执行所需的任何处理,然后向通知中心提交推送通知。 See https://docs.microsoft.com/en-us/azure/azure-functions/ for the documentation source on this.
有关此文档的来源,请参见https://docs.microsoft.com/zh-cn/azure/azure-functions/ 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.