Beispiel #1
0
 public ChangeFeedReceiver(IMessagingInfrastructureProvider infrastructureProvider,
                           MessageBrokerOptions messageBrokerOptions,
                           ILogger <BrokeredMessageReceiver <TProcessorCommand> > logger,
                           IServiceScopeFactory serviceFactory,
                           IMaxReceivesExceededAction recoveryAction,
                           ICriticalFailureNotifier criticalFailureNotifier,
                           IRecoveryStrategy recoveryStrategy,
                           IReceivedMessageDispatcher receivedMessageDispatcher)
     : base(infrastructureProvider, messageBrokerOptions, logger, recoveryAction, criticalFailureNotifier, recoveryStrategy, receivedMessageDispatcher)
 {
     _serviceFactory = serviceFactory ?? throw new ArgumentNullException(nameof(serviceFactory));
 }
        /// <summary>
        /// Creates a brokered message receiver that receives messages of <typeparamref name="TMessage"/>
        /// </summary>
        /// <param name="infrastructureProvider">The message broker infrastructure</param>
        /// <param name="serviceFactory">The service scope factory used to create a new scope when a message is received from the messaging infrastructure.</param>
        /// <param name="logger">Provides logging capability</param>
        public BrokeredMessageReceiver(IMessagingInfrastructureProvider infrastructureProvider,
                                       MessageBrokerOptions messageBrokerOptions,
                                       ILogger <BrokeredMessageReceiver <TMessage> > logger,
                                       IMaxReceivesExceededAction recoveryAction,
                                       ICriticalFailureNotifier criticalFailureNotifier,
                                       IRecoveryStrategy recoveryStrategy,
                                       IReceivedMessageDispatcher receivedMessageDispatcher)
        {
            if (infrastructureProvider is null)
            {
                throw new ArgumentNullException(nameof(infrastructureProvider));
            }

            _infrastructureProvider = infrastructureProvider;
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _failedRecoveryAction      = recoveryAction;
            _criticalFailureNotifier   = criticalFailureNotifier ?? throw new ArgumentNullException(nameof(criticalFailureNotifier));
            _messageBrokerOptions      = messageBrokerOptions ?? throw new ArgumentNullException(nameof(messageBrokerOptions));
            _recoveryStrategy          = recoveryStrategy ?? throw new ArgumentNullException(nameof(recoveryStrategy));
            _receivedMessageDispatcher = receivedMessageDispatcher ?? throw new ArgumentNullException(nameof(receivedMessageDispatcher));
        }