/// <summary> /// Initializes a new instance of the <see cref="SubscriptionProcessor"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="serviceBusConfiguration">The configuration for the service bus.</param> /// <param name="currentStamp">The current stamp configuration.</param> /// <param name="metricsTracker">The metrics tracker.</param> /// <param name="subscriptionMonitor">The service monitor.</param> public SubscriptionProcessor(ILogger <SubscriptionProcessor> logger, IOptions <ServiceBusConfiguration> serviceBusConfiguration, IMonitor subscriptionMonitor) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _serviceBusConfiguration = serviceBusConfiguration?.Value ?? throw new ArgumentNullException(nameof(serviceBusConfiguration)); _serviceBusConfiguration.CheckValidity(); _subscriptionMonitor = subscriptionMonitor ?? throw new ArgumentNullException(nameof(subscriptionMonitor)); }
/// <summary> /// Initializes a new instance of the <see cref="SubscriptionMonitor"/> class. /// </summary> /// <param name="serviceBusConfiguration">The endpoint configuration.</param> public SubscriptionMonitor(IOptions <ServiceBusConfiguration> serviceBusConfiguration) { _serviceBusConfiguration = serviceBusConfiguration?.Value ?? throw new ArgumentNullException(nameof(serviceBusConfiguration)); _serviceBusConfiguration.CheckValidity(); _gracePeriod = TimeSpan.FromSeconds(_serviceBusConfiguration.SbMonitorGracePeriod); _possibleRetriesInEvaluationPeriod = CalculateMaxNumberOfExceptionsByGracePeriod(); _exceptionsTimestamps = new List <int>(); }