From d3bd0fabfdc7557a495cf0fe3af66cecd05570a0 Mon Sep 17 00:00:00 2001 From: Christian Arenas Date: Wed, 24 May 2017 16:26:40 +0200 Subject: [PATCH] change log leve --- .../EventBusServiceBus/EventBusServiceBus.cs | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs index 1433a9f65..3e941c8e0 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs @@ -29,6 +29,8 @@ _subscriptionClient = new SubscriptionClient(serviceBusPersisterConnection.ServiceBusConnectionStringBuilder, subscriptionClientName); + + CreateConsumerChannel(); } public void Publish(IntegrationEvent @event) @@ -69,7 +71,7 @@ } catch(ServiceBusException) { - _logger.LogWarning($"The messaging entity {eventName} already exists."); + _logger.LogInformation($"The messaging entity {eventName} already exists."); } } @@ -91,7 +93,7 @@ } catch (MessagingEntityNotFoundException) { - _logger.LogWarning($"The messaging entity {eventName} Could not be found."); + _logger.LogInformation($"The messaging entity {eventName} Could not be found."); } _subsManager.RemoveSubscription(); @@ -102,17 +104,17 @@ _subsManager.Clear(); } - //private async Task CreateConsumerChannel() - //{ - // _subscriptionClient.RegisterMessageHandler( - // async (message, token) => - // { - // var eventName = message.Label; - // var messageData = Encoding.UTF8.GetString(message.Body); - // await ProcessEvent(eventName, messageData); - // }, - // new MessageHandlerOptions() { MaxConcurrentCalls = 10, AutoComplete = true }); - //} + private void CreateConsumerChannel() + { + _subscriptionClient.RegisterMessageHandler( + async (message, token) => + { + var eventName = message.Label; + var messageData = Encoding.UTF8.GetString(message.Body); + await ProcessEvent(eventName, messageData); + }, + new MessageHandlerOptions() { MaxConcurrentCalls = 10, AutoComplete = true }); + } private async Task ProcessEvent(string eventName, string message) {