EventProcessorHost не прослушивает сервер Azure в веб-API
Я использовал EventProcessorHost для прослушивания Azure Hub Event. Я создал асинхронный метод в классе для RegisterEventProcessorAsync с конфигурацией концентратора событий. и используя этот асинхронный метод в моем классе Startup.cs. Он работает нормально на локальном компьютере, но при развертывании на Azure он не работает. Это мой метод для регистрации событий концентратора и класса startup.cs.
public static class ProcesssRTS
{
private static string EhConnectionString =""
private static string EhEntityPath =""
private static string StorageContainerName =""
private static string StorageAccountName =""
private static string StorageAccountKey =""
private static readonly string StorageConnectionString = string.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}", StorageAccountName, StorageAccountKey);
public static async Task MainAsync()
{
Console.WriteLine("Registering EventProcessor...");
var eventProcessorHost = new EventProcessorHost(
EhEntityPath,
PartitionReceiver.DefaultConsumerGroupName,
EhConnectionString,
StorageConnectionString,
StorageContainerName);
await eventProcessorHost.RegisterEventProcessorAsync<RTSEventProcessor>();
Console.WriteLine("Receiving. Press ENTER to stop worker.");
Console.ReadLine();
await eventProcessorHost.UnregisterEventProcessorAsync();
}
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
ProcesssRTS.MainAsync();
app.Map("/signalr", map =>
{
map.UseCors(CorsOptions.AllowAll);
var hubConfiguration = new HubConfiguration { };
map.RunSignalR(hubConfiguration);
});
}
}