public RebusDistributedEventBus(
        IServiceScopeFactory serviceScopeFactory,
        ICurrentTenant currentTenant,
        IUnitOfWorkManager unitOfWorkManager,
        IBus rebus,
        IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
        IOptions <AbpRebusEventBusOptions> abpEventBusRebusOptions,
        IRebusSerializer serializer,
        IGuidGenerator guidGenerator,
        IClock clock,
        IEventHandlerInvoker eventHandlerInvoker) :
        base(
            serviceScopeFactory,
            currentTenant,
            unitOfWorkManager,
            abpDistributedEventBusOptions,
            guidGenerator,
            clock,
            eventHandlerInvoker)
    {
        Rebus      = rebus;
        Serializer = serializer;
        AbpRebusEventBusOptions = abpEventBusRebusOptions.Value;

        HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
        EventTypes       = new ConcurrentDictionary <string, Type>();
    }
 public AzureDistributedEventBus(
     IServiceScopeFactory serviceScopeFactory,
     ICurrentTenant currentTenant,
     IUnitOfWorkManager unitOfWorkManager,
     IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
     IGuidGenerator guidGenerator,
     IClock clock,
     IOptions <AbpAzureEventBusOptions> abpAzureEventBusOptions,
     IAzureServiceBusSerializer serializer,
     IAzureServiceBusMessageConsumerFactory messageConsumerFactory,
     IPublisherPool publisherPool,
     IEventHandlerInvoker eventHandlerInvoker)
     : base(serviceScopeFactory,
            currentTenant,
            unitOfWorkManager,
            abpDistributedEventBusOptions,
            guidGenerator,
            clock,
            eventHandlerInvoker)
 {
     _options                = abpAzureEventBusOptions.Value;
     _serializer             = serializer;
     _messageConsumerFactory = messageConsumerFactory;
     _publisherPool          = publisherPool;
     _handlerFactories       = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
     _eventTypes             = new ConcurrentDictionary <string, Type>();
 }
Example #3
0
    public RabbitMqDistributedEventBus(
        IOptions <AbpRabbitMqEventBusOptions> options,
        IConnectionPool connectionPool,
        IRabbitMqSerializer serializer,
        IServiceScopeFactory serviceScopeFactory,
        IOptions <AbpDistributedEventBusOptions> distributedEventBusOptions,
        IRabbitMqMessageConsumerFactory messageConsumerFactory,
        ICurrentTenant currentTenant,
        IUnitOfWorkManager unitOfWorkManager,
        IGuidGenerator guidGenerator,
        IClock clock,
        IEventHandlerInvoker eventHandlerInvoker)
        : base(
            serviceScopeFactory,
            currentTenant,
            unitOfWorkManager,
            distributedEventBusOptions,
            guidGenerator,
            clock,
            eventHandlerInvoker)
    {
        ConnectionPool             = connectionPool;
        Serializer                 = serializer;
        MessageConsumerFactory     = messageConsumerFactory;
        AbpRabbitMqEventBusOptions = options.Value;

        HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
        EventTypes       = new ConcurrentDictionary <string, Type>();
    }
    public KafkaDistributedEventBus(
        IServiceScopeFactory serviceScopeFactory,
        ICurrentTenant currentTenant,
        IUnitOfWorkManager unitOfWorkManager,
        IOptions <AbpKafkaEventBusOptions> abpKafkaEventBusOptions,
        IKafkaMessageConsumerFactory messageConsumerFactory,
        IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
        IKafkaSerializer serializer,
        IProducerPool producerPool,
        IGuidGenerator guidGenerator,
        IClock clock,
        IEventHandlerInvoker eventHandlerInvoker)
        : base(
            serviceScopeFactory,
            currentTenant,
            unitOfWorkManager,
            abpDistributedEventBusOptions,
            guidGenerator,
            clock,
            eventHandlerInvoker)
    {
        AbpKafkaEventBusOptions = abpKafkaEventBusOptions.Value;
        MessageConsumerFactory  = messageConsumerFactory;
        Serializer   = serializer;
        ProducerPool = producerPool;

        HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
        EventTypes       = new ConcurrentDictionary <string, Type>();
    }
Example #5
0
        public InProcEventPublisher(EventHandlers eventHandlers, IEventHandlerInvoker eventHandlerInvoker)
        {
            Ensure.That(eventHandlers, "eventHandlers").IsNotNull();
            Ensure.That(eventHandlerInvoker, "eventHandlerInvoker").IsNotNull();

            EventHandlers       = eventHandlers;
            EventHandlerInvoker = eventHandlerInvoker;
        }
        public InProcEventPublisher(EventHandlers eventHandlers, IEventHandlerInvoker eventHandlerInvoker)
        {
            Ensure.That(eventHandlers, "eventHandlers").IsNotNull();
            Ensure.That(eventHandlerInvoker, "eventHandlerInvoker").IsNotNull();

            EventHandlers = eventHandlers;
            EventHandlerInvoker = eventHandlerInvoker;
        }
Example #7
0
 public AbstractEventProcessor(string name, IEventHandlerInvoker eventHandlerInvoker, RollbackConfigurationType rollbackConfiguration, IErrorHandler errorHandler, IMessageMonitor messageMonitor)
 {
     EventHandlerInvoker    = eventHandlerInvoker ?? throw new ArgumentNullException(nameof(name));
     _rollbackConfiguration = rollbackConfiguration;
     _errorHandler          = errorHandler ?? PropagatingErrorHandler.Instance;
     _messageMonitor        = messageMonitor ?? NoOpMessageMonitor.Instance;
     Name = name ?? throw new ArgumentNullException(nameof(name));
 }
Example #8
0
 public SubscribingEventProcessor(String name,
                                  IEventHandlerInvoker eventHandlerInvoker,
                                  ISubscribableMessageSource <IEventMessage> messageSource,
                                  IEventProcessingStrategy processingStrategy,
                                  IErrorHandler errorHandler)
     : this(name, eventHandlerInvoker, messageSource, processingStrategy, errorHandler, NoOpMessageMonitor.Instance)
 {
 }
Example #9
0
 public SubscribingEventProcessor(String name,
                                  IEventHandlerInvoker eventHandlerInvoker,
                                  ISubscribableMessageSource <IEventMessage> messageSource,
                                  IEventProcessingStrategy processingStrategy,
                                  IErrorHandler errorHandler,
                                  IMessageMonitor messageMonitor)
     : this(name, eventHandlerInvoker, RollbackConfigurationType.AnyThrowable, messageSource, processingStrategy,
            errorHandler, messageMonitor)
 {
 }
Example #10
0
 protected EventBusBase(
     IServiceScopeFactory serviceScopeFactory,
     ICurrentTenant currentTenant,
     IUnitOfWorkManager unitOfWorkManager,
     IEventHandlerInvoker eventHandlerInvoker)
 {
     ServiceScopeFactory = serviceScopeFactory;
     CurrentTenant       = currentTenant;
     UnitOfWorkManager   = unitOfWorkManager;
     EventHandlerInvoker = eventHandlerInvoker;
 }
Example #11
0
 public SubscribingEventProcessor(String name,
                                  IEventHandlerInvoker eventHandlerInvoker,
                                  RollbackConfigurationType rollbackConfiguration,
                                  ISubscribableMessageSource <IEventMessage> messageSource,
                                  IEventProcessingStrategy processingStrategy,
                                  IErrorHandler errorHandler,
                                  IMessageMonitor messageMonitor)
     : base(name, eventHandlerInvoker, rollbackConfiguration, errorHandler, messageMonitor)
 {
     _messageSource      = messageSource;
     _processingStrategy = processingStrategy;
 }
Example #12
0
    public LocalEventBus(
        IOptions <AbpLocalEventBusOptions> options,
        IServiceScopeFactory serviceScopeFactory,
        ICurrentTenant currentTenant,
        IUnitOfWorkManager unitOfWorkManager,
        IEventHandlerInvoker eventHandlerInvoker)
        : base(serviceScopeFactory, currentTenant, unitOfWorkManager, eventHandlerInvoker)
    {
        Options = options.Value;
        Logger  = NullLogger <LocalEventBus> .Instance;

        HandlerFactories = new ConcurrentDictionary <Type, List <IEventHandlerFactory> >();
        SubscribeHandlers(Options.Handlers);
    }
Example #13
0
 protected DistributedEventBusBase(
     IServiceScopeFactory serviceScopeFactory,
     ICurrentTenant currentTenant,
     IUnitOfWorkManager unitOfWorkManager,
     IOptions <AbpDistributedEventBusOptions> abpDistributedEventBusOptions,
     IGuidGenerator guidGenerator,
     IClock clock,
     IEventHandlerInvoker eventHandlerInvoker
     ) : base(
         serviceScopeFactory,
         currentTenant,
         unitOfWorkManager,
         eventHandlerInvoker)
 {
     GuidGenerator = guidGenerator;
     Clock         = clock;
     AbpDistributedEventBusOptions = abpDistributedEventBusOptions.Value;
 }
 public InProcAsyncEventPublisher(EventHandlers eventHandlers, IEventHandlerInvoker eventHandlerInvoker)
     : base(eventHandlers, eventHandlerInvoker)
 {
 }
Example #15
0
 public EventHandlerInvoker_Tests()
 {
     _eventHandlerInvoker = GetRequiredService <IEventHandlerInvoker>();
 }
Example #16
0
 public SubscribingEventProcessor(String name, IEventHandlerInvoker eventHandlerInvoker, ISubscribableMessageSource <IEventMessage> messageSource)
     : this(name, eventHandlerInvoker, messageSource, DirectEventProcessingStrategy.Instance, PropagatingErrorHandler.Instance)
 {
 }
Example #17
0
 public InProcAsyncEventPublisher(EventHandlers eventHandlers, IEventHandlerInvoker eventHandlerInvoker)
     : base(eventHandlers, eventHandlerInvoker)
 {
 }