/// <summary>
 /// Create processor
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="logger"></param>
 public DefaultProcessor(EventProcessorFactory factory, ILogger logger)
 {
     _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
     _factory     = factory ?? throw new ArgumentNullException(nameof(factory));
     _processorId = Guid.NewGuid().ToString();
     logger.Information("EventProcessor {id} created", _processorId);
 }
Пример #2
0
 /// <summary>
 /// Create processor
 /// </summary>
 /// <param name="factory"></param>
 /// <param name="logger"></param>
 public DefaultProcessor(EventProcessorFactory factory, ILogger logger)
 {
     _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
     _factory     = factory ?? throw new ArgumentNullException(nameof(factory));
     _processorId = Guid.NewGuid().ToString();
     _interval    = (long?)_factory._config.CheckpointInterval?.TotalMilliseconds
                    ?? long.MaxValue;
     _sw = Stopwatch.StartNew();
     logger.Information("EventProcessor {id} created", _processorId);
 }
Пример #3
0
            /// <summary>
            /// Create processor
            /// </summary>
            /// <param name="outer"></param>
            /// <param name="logger"></param>
            public DefaultProcessor(EventProcessorFactory outer, ILogger logger)
            {
                _outer       = outer ?? throw new ArgumentNullException(nameof(outer));
                _processorId = Guid.NewGuid().ToString();
                _logger      = logger?.ForContext("ProcessorId", _processorId)
                               ?? throw new ArgumentNullException(nameof(logger));

                _handler  = outer._context.Resolve <IEventProcessingHandler>();
                _interval = (long?)_outer._config.CheckpointInterval?.TotalMilliseconds
                            ?? long.MaxValue;

                _sw = Stopwatch.StartNew();
                logger.Information("EventProcessor {id} created", _processorId);
            }
Пример #4
0
            /// <summary>
            /// Create processor
            /// </summary>
            /// <param name="outer"></param>
            /// <param name="partitionContext"></param>
            /// <param name="logger"></param>
            public DefaultProcessor(EventProcessorFactory outer, PartitionContext partitionContext,
                                    ILogger logger)
            {
                _outer            = outer ?? throw new ArgumentNullException(nameof(outer));
                _partitionContext = partitionContext ?? throw new ArgumentNullException(nameof(partitionContext));
                _processorId      = Guid.NewGuid().ToString();
                _logger           = logger?.ForContext("ProcessorId", _processorId)
                                    ?? throw new ArgumentNullException(nameof(logger));

                _handler  = outer._context.Resolve <IEventProcessingHandler>();
                _interval = (long?)_outer._config.CheckpointInterval?.TotalMilliseconds
                            ?? long.MaxValue;

                _sw = Stopwatch.StartNew();
                _logger.Information("EventProcessor {id} for partition {partitionId} created",
                                    _processorId, _partitionContext.PartitionId);
                kEventProcessorDetails.WithLabels(_processorId, _partitionContext.EventHubPath, _partitionContext.ConsumerGroupName,
                                                  _partitionContext.PartitionId, "created").Inc();
            }