This commit is contained in:
Serkant Karaca 2019-07-02 09:39:13 -07:00
Родитель c030b6d5c1
Коммит 1306652fa8
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -41,11 +41,9 @@ namespace CustomRole
var storageCredentials = new StorageCredentials(tokenCredential);
CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(storageCredentials, StorageAccountName, string.Empty, true);
// Create Event Hubs account with access token provider
// Create Event Hubs access token provider and processor host
TokenProvider tp = TokenProvider.CreateAzureActiveDirectoryTokenProvider(
new AzureActiveDirectoryTokenProvider.AuthenticationCallback(GetAccessToken), Authority, tokenClient);
Console.WriteLine("Registering EventProcessor...");
var eventProcessorHost = new EventProcessorHost(
new Uri(EventHubNamespace),
EventHubName,
@ -55,6 +53,7 @@ namespace CustomRole
StorageContainerName);
// Registers the Event Processor Host and starts receiving messages
Console.WriteLine("Registering EventProcessor...");
await eventProcessorHost.RegisterEventProcessorAsync<SimpleEventProcessor>();
Console.WriteLine("Receiving. Press enter key to stop worker.");