public EventStreamSubscriberSettingsBuilder(IEventStoreHttpConnection connection, IEventHandlerResolver eventHandlerResolver, IStreamPositionRepository streamPositionRepository)
 {
     _connection = connection;
     _eventHandlerResolver = eventHandlerResolver;
     _streamPositionRepository = streamPositionRepository;
     _subscriptionTimerManager = new SubscriptionTimerManager();
     _subscriberIntervalMonitor = new StreamSubscriberIntervalMonitor();
 }
Exemplo n.º 2
0
 public EventStreamSubscriberSettingsBuilder(IEventStoreHttpConnection connection, IEventHandlerResolver eventHandlerResolver, IStreamPositionRepository streamPositionRepository)
 {
     _connection                = connection;
     _eventHandlerResolver      = eventHandlerResolver;
     _streamPositionRepository  = streamPositionRepository;
     _subscriptionTimerManager  = new SubscriptionTimerManager();
     _subscriberIntervalMonitor = new StreamSubscriberIntervalMonitor();
 }
 internal EventStreamSubscriberSettings(IEventStoreHttpConnection connection, IEventHandlerResolver eventHandlerResolver, IStreamPositionRepository streamPositionRepository, ISubscriptionTimerManager subscriptionTimerManager, IEventTypeResolver eventTypeResolver, TimeSpan pollingInterval, int sliceSize, ILog log, TimeSpan messageProcessingStatsWindowPeriod, int messageProcessingStatsWindowCount, TimeSpan? longPollingTimeout, IEnumerable<IEventStreamSubscriberPerformanceMonitor> performanceMonitors, IStreamSubscriberIntervalMonitor streamSubscriberIntervalMonitor)
 {
     Connection = connection;
     EventHandlerResolver = eventHandlerResolver;
     StreamPositionRepository = streamPositionRepository;
     SubscriptionTimerManager = subscriptionTimerManager;
     EventTypeResolver = eventTypeResolver;
     DefaultPollingInterval = pollingInterval;
     SliceSize = sliceSize;
     Log = log;
     MessageProcessingStatsWindowPeriod = messageProcessingStatsWindowPeriod;
     MessageProcessingStatsWindowCount = messageProcessingStatsWindowCount;
     LongPollingTimeout = longPollingTimeout;
     PerformanceMonitors = performanceMonitors;
     SubscriberIntervalMonitor = streamSubscriberIntervalMonitor;
 }
 internal EventStreamSubscriber(EventStreamSubscriberSettings settings)
 {
     _connection = settings.Connection;
     _eventHandlerResolver = settings.EventHandlerResolver;
     _streamPositionRepository = settings.StreamPositionRepository;
     _subscriptionTimerManager = settings.SubscriptionTimerManager;
     _eventTypeResolver = settings.EventTypeResolver;
     _defaultPollingInterval = settings.DefaultPollingInterval;
     _sliceSize = settings.SliceSize;
     _longPollingTimeout = settings.LongPollingTimeout;
     _performanceMonitors = settings.PerformanceMonitors;
     _log = settings.Log;
     
     StreamSubscriberMonitor = settings.SubscriberIntervalMonitor;
     AllEventsStats = new PerformanceStats(settings.MessageProcessingStatsWindowPeriod, settings.MessageProcessingStatsWindowCount);
     ProcessedEventsStats = new PerformanceStats(settings.MessageProcessingStatsWindowPeriod, settings.MessageProcessingStatsWindowCount);
 }
 internal EventStreamSubscriberSettings(IEventStoreHttpConnection connection, IEventHandlerResolver eventHandlerResolver, IStreamPositionRepository streamPositionRepository, ISubscriptionTimerManager subscriptionTimerManager, IEventTypeResolver eventTypeResolver, TimeSpan pollingInterval, int sliceSize, ILog log, TimeSpan messageProcessingStatsWindowPeriod, int messageProcessingStatsWindowCount, TimeSpan?longPollingTimeout, IEnumerable <IEventStreamSubscriberPerformanceMonitor> performanceMonitors, IStreamSubscriberIntervalMonitor streamSubscriberIntervalMonitor, int eventNotFoundRetryCount, TimeSpan eventNotFoundRetryDelay)
 {
     Connection               = connection;
     EventHandlerResolver     = eventHandlerResolver;
     StreamPositionRepository = streamPositionRepository;
     SubscriptionTimerManager = subscriptionTimerManager;
     EventTypeResolver        = eventTypeResolver;
     DefaultPollingInterval   = pollingInterval;
     SliceSize = sliceSize;
     Log       = log;
     MessageProcessingStatsWindowPeriod = messageProcessingStatsWindowPeriod;
     MessageProcessingStatsWindowCount  = messageProcessingStatsWindowCount;
     LongPollingTimeout        = longPollingTimeout;
     PerformanceMonitors       = performanceMonitors;
     SubscriberIntervalMonitor = streamSubscriberIntervalMonitor;
     EventNotFoundRetryCount   = eventNotFoundRetryCount;
     EventNotFoundRetryDelay   = eventNotFoundRetryDelay;
 }
Exemplo n.º 6
0
            public LoggingEventPublisher(IEventHandlerResolver resolver, ILoggerFactory loggerFactory) : base(resolver)
            {
                ILogger logger = loggerFactory.CreateLogger(nameof(LoggingEventPublisher));

                OnError += (e, ex) =>
                {
                    string errorMessage =
                        $"------------------------------------------------------" +
                        Environment.NewLine +

                        $"{e.GetType().Name} have failed processing." +

                        Environment.NewLine +
                        $"------------------------------------------------------";

                    logger.LogError(ex, errorMessage);
                };
            }
        internal EventStreamSubscriber(EventStreamSubscriberSettings settings)
        {
            _connection               = settings.Connection;
            _eventHandlerResolver     = settings.EventHandlerResolver;
            _streamPositionRepository = settings.StreamPositionRepository;
            _subscriptionTimerManager = settings.SubscriptionTimerManager;
            _eventTypeResolver        = settings.EventTypeResolver;
            _defaultPollingInterval   = settings.DefaultPollingInterval;
            _sliceSize           = settings.SliceSize;
            _longPollingTimeout  = settings.LongPollingTimeout;
            _performanceMonitors = settings.PerformanceMonitors;
            _log = settings.Log;

            _eventNotFoundRetryCount = settings.EventNotFoundRetryCount;
            _eventNotFoundRetryDelay = settings.EventNotFoundRetryDelay;

            StreamSubscriberMonitor = settings.SubscriberIntervalMonitor;
            AllEventsStats          = new PerformanceStats(settings.MessageProcessingStatsWindowPeriod, settings.MessageProcessingStatsWindowCount);
            ProcessedEventsStats    = new PerformanceStats(settings.MessageProcessingStatsWindowPeriod, settings.MessageProcessingStatsWindowCount);
        }
 /// <summary>
 /// Creates a new set of <see cref="EventStreamSubscriberSettings"/>
 /// </summary>
 /// <returns>A <see cref="EventStreamSubscriberSettings"/> that can be used to build up an <see cref="EventStreamSubscriber"/></returns>
 public static EventStreamSubscriberSettings Default(IEventStoreHttpConnection connection, IEventHandlerResolver eventHandlerResolver, IStreamPositionRepository streamPositionRepository)
 {
     return(new EventStreamSubscriberSettingsBuilder(connection, eventHandlerResolver, streamPositionRepository));
 }
 /// <summary>
 /// Creates a new <see cref="IEventStreamSubscriber"/> to single node using default <see cref="ConnectionSettings"/>
 /// </summary>
 /// <returns>a new <see cref="IEventStreamSubscriber"/></returns>
 public static IEventStreamSubscriber Create(IEventStoreHttpConnection connection, IEventHandlerResolver eventHandlerResolver, IStreamPositionRepository streamPositionRepository)
 {
     return new EventStreamSubscriber(EventStreamSubscriberSettings.Default(connection, eventHandlerResolver, streamPositionRepository));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Contructor.
 /// </summary>
 /// <param name="resolver">Event handler resolver.</param>
 public EventPublisher(IEventHandlerResolver resolver)
 {
     _resolver = resolver;
 }
 public DelegatedActivation(IEventHandlerResolver eventHandlerResolver, Func<Type, object> createHandler, Func<Type, object> createHandlerAsync)
     : base(eventHandlerResolver, createHandler, createHandlerAsync)
 {
 }
Exemplo n.º 12
0
 public EventBus(IEventHandlerResolver resolver)
 {
     _resolver = resolver ?? throw new ArgumentNullException(nameof(resolver));
 }
Exemplo n.º 13
0
 public EventStore(EventStoreContext db, IReadStoreTransactionProvider rsTransactionProvider, IEventHandlerResolver handler)
 {
     _db = db;
     _rsTransactionProvider = rsTransactionProvider;
     _handler = handler;
 }
 public WriteRepositoryEventSubscriber(IEventHandlerResolver eventHandlerResolver)
 {
     _eventHandlerResolver = eventHandlerResolver;
 }