Example #1
0
 public void Start()
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(_topic))
         {
             _removeMessageContext = _MessageQueueClient.StartSubscriptionClient(_topic, _subscriptionName, _consumerId, OnMessagesReceived);
         }
         _messageProcessor.Start();
     }
     catch (Exception e)
     {
         _logger.Error(e.GetBaseException().Message, e);
     }
 }
Example #2
0
 public void Start()
 {
     _topics.ForEach(topic =>
     {
         try
         {
             if (!string.IsNullOrWhiteSpace(topic))
             {
                 _MessageQueueClient.StartSubscriptionClient(topic, _subscriptionName, OnMessageReceived);
             }
         }
         catch (Exception e)
         {
             _logger.Error(e.GetBaseException().Message, e);
         }
     });
 }
Example #3
0
        public void Start()
        {
            try
            {
                if (_topicSubscriptions?.Length > 0)
                {
                    InternalConsumer =
                        MessageQueueClient.StartSubscriptionClient(_topicSubscriptions.Select(ts => ts.Topic)
                                                                   .ToArray(),
                                                                   SubscriptionName,
                                                                   ConsumerId,
                                                                   OnMessagesReceived,
                                                                   ConsumerConfig);
                }

                MessageProcessor.Start();
            }
            catch (Exception e)
            {
                Logger.LogError(e, $"Event Subscriber {string.Join(",", _topicSubscriptions?.Select(ts => ts.Topic) ?? new string[0])} start faield");
            }
        }