Esempio n. 1
0
 public EventBatchingTests()
 {
     _eventConsumerService = Substitute.For <IEventConsumerService>();
     _checkpointClient     = Substitute.For <ICheckpointClient>();
     _logger = Substitute.For <ITelemetryLogger>();
     _options.FlushTimespan = 300;
     _options.MaxEvents     = 5;
 }
Esempio n. 2
0
 public BaseEventProcessor(
     EventProcessorClient eventProcessorClient,
     IEventConsumerService eventConsumerService,
     ICheckpointClient checkpointClient,
     ITelemetryLogger logger)
 {
     EventConsumerService = EnsureArg.IsNotNull(eventConsumerService, nameof(eventConsumerService));
     CheckpointClient     = EnsureArg.IsNotNull(checkpointClient, nameof(checkpointClient));
     EventProcessorClient = EnsureArg.IsNotNull(eventProcessorClient, nameof(eventProcessorClient));
     Logger = EnsureArg.IsNotNull(logger, nameof(logger));
 }
        public EventBatchingService(IEventConsumerService eventConsumerService, EventBatchingOptions options, ICheckpointClient checkpointClient, ITelemetryLogger logger)
        {
            EnsureArg.IsNotNull(options);
            EnsureArg.IsInt(options.MaxEvents);
            EnsureArg.IsInt(options.FlushTimespan);

            _eventPartitions      = new ConcurrentDictionary <string, EventPartition>();
            _eventConsumerService = eventConsumerService;
            _maxEvents            = options.MaxEvents;
            _flushTimespan        = TimeSpan.FromSeconds(options.FlushTimespan);
            _checkpointClient     = checkpointClient;
            _logger = logger;
        }
Esempio n. 4
0
        public static EventProcessor GetEventProcessor(
            IConfiguration config,
            IEventConsumerService eventConsumerService,
            ICheckpointClient checkpointClient,
            ITelemetryLogger logger)
        {
            var eventBatchingOptions = new EventBatchingOptions();

            config.GetSection(EventBatchingOptions.Settings).Bind(eventBatchingOptions);
            var eventBatchingService = new EventBatchingService(eventConsumerService, eventBatchingOptions, checkpointClient, logger);
            var eventHubReader       = new EventProcessor(eventBatchingService, checkpointClient, logger);

            return(eventHubReader);
        }
Esempio n. 5
0
 public EventProcessor(IEventConsumerService eventConsumerService, ICheckpointClient checkpointClient, ITelemetryLogger logger)
 {
     _eventConsumerService = eventConsumerService;
     _checkpointClient     = checkpointClient;
     _logger = logger;
 }
Esempio n. 6
0
 public EventProcessor(EventProcessorClient processor, IEventConsumerService eventConsumerService, ICheckpointClient checkpointClient, ITelemetryLogger logger)
     : base(processor, eventConsumerService, checkpointClient, logger)
 {
 }