Ejemplo n.º 1
0
 public AzureServiceBusConsumer(string topicName, string subscriptionName, IAmAMessageProducer messageProducer, IManagementClientWrapper managementClientWrapper, IMessageReceiverProvider messageReceiverProvider, int batchSize = 10)
 {
     _subscriptionName        = subscriptionName;
     _topicName               = topicName;
     _messageProducer         = messageProducer;
     _managementClientWrapper = managementClientWrapper;
     _batchSize               = batchSize;
     _messageReceiver         = messageReceiverProvider.Get(_topicName, subscriptionName, ReceiveMode.PeekLock);
 }
Ejemplo n.º 2
0
 private void GetMessageReceiverProvider()
 {
     s_logger.LogInformation($"Getting message receiver provider for topic {_topicName} and subscription {_subscriptionName} with receive Mode {_receiveMode}...");
     try
     {
         _messageReceiver = _messageReceiverProvider.Get(_topicName, _subscriptionName, _receiveMode);
     }
     catch (Exception e)
     {
         s_logger.LogError(e, $"Failed to get message receiver provider for topic {_topicName} and subscription {_subscriptionName}.");
     }
 }