Esempio n. 1
0
        public EventHubAdapterReceiver(EventHubPartitionSettings settings,
            Func<string, IStreamQueueCheckpointer<string>, Logger, ITelemetryProducer, IEventHubQueueCache> cacheFactory,
            Func<string, Task<IStreamQueueCheckpointer<string>>> checkpointerFactory,
            Logger baseLogger,
            IQueueAdapterReceiverMonitor monitor,
            Factory<NodeConfiguration> getNodeConfig,
            ITelemetryProducer telemetryProducer,
            Func<EventHubPartitionSettings, string, Logger, ITelemetryProducer, Task<IEventHubReceiver>> eventHubReceiverFactory = null)
        {
            if (settings == null) throw new ArgumentNullException(nameof(settings));
            if (cacheFactory == null) throw new ArgumentNullException(nameof(cacheFactory));
            if (checkpointerFactory == null) throw new ArgumentNullException(nameof(checkpointerFactory));
            if (baseLogger == null) throw new ArgumentNullException(nameof(baseLogger));
            if (monitor == null) throw new ArgumentNullException(nameof(monitor));
            if (telemetryProducer == null) throw new ArgumentNullException(nameof(telemetryProducer));
            this.settings = settings;
            this.cacheFactory = cacheFactory;
            this.checkpointerFactory = checkpointerFactory;
            this.baseLogger = baseLogger;
            this.logger = baseLogger.GetSubLogger("receiver", "-");
            this.monitor = monitor;
            this.getNodeConfig = getNodeConfig;
            this.telemetryProducer = telemetryProducer;

            this.eventHubReceiverFactory = eventHubReceiverFactory == null ? EventHubAdapterReceiver.CreateReceiver : eventHubReceiverFactory;
        }
Esempio n. 2
0
 public MemoryAdapterReceiver(IMemoryStreamQueueGrain queueGrain, Logger logger, TSerializer serializer, IQueueAdapterReceiverMonitor receiverMonitor)
 {
     this.queueGrain      = queueGrain;
     this.logger          = logger;
     this.serializer      = serializer;
     awaitingTasks        = new List <Task>();
     this.receiverMonitor = receiverMonitor;
 }
Esempio n. 3
0
        public EventHubAdapterReceiver(EventHubPartitionSettings settings,
                                       Func <string, IStreamQueueCheckpointer <string>, ILoggerFactory, ITelemetryProducer, IEventHubQueueCache> cacheFactory,
                                       Func <string, Task <IStreamQueueCheckpointer <string> > > checkpointerFactory,
                                       ILoggerFactory loggerFactory,
                                       IQueueAdapterReceiverMonitor monitor,
                                       LoadSheddingOptions loadSheddingOptions,
                                       ITelemetryProducer telemetryProducer,
                                       Func <EventHubPartitionSettings, string, ILogger, ITelemetryProducer, IEventHubReceiver> eventHubReceiverFactory = null)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            if (cacheFactory == null)
            {
                throw new ArgumentNullException(nameof(cacheFactory));
            }
            if (checkpointerFactory == null)
            {
                throw new ArgumentNullException(nameof(checkpointerFactory));
            }
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }
            if (monitor == null)
            {
                throw new ArgumentNullException(nameof(monitor));
            }
            if (loadSheddingOptions == null)
            {
                throw new ArgumentNullException(nameof(loadSheddingOptions));
            }
            if (telemetryProducer == null)
            {
                throw new ArgumentNullException(nameof(telemetryProducer));
            }
            this.settings            = settings;
            this.cacheFactory        = cacheFactory;
            this.checkpointerFactory = checkpointerFactory;
            this.loggerFactory       = loggerFactory;
            this.logger              = this.loggerFactory.CreateLogger($"{this.GetType().FullName}.{settings.Hub.Path}.{settings.Partition}");
            this.monitor             = monitor;
            this.telemetryProducer   = telemetryProducer;
            this.loadSheddingOptions = loadSheddingOptions;

            this.eventHubReceiverFactory = eventHubReceiverFactory == null ? EventHubAdapterReceiver.CreateReceiver : eventHubReceiverFactory;
        }
Esempio n. 4
0
 public Receiver(IQueueAdapterReceiverMonitor receiverMonitor)
 {
     this.receiverMonitor = receiverMonitor;
 }