예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="persistentConnection"></param>
 /// <param name="serviceProvider"></param>
 /// <param name="eventHandlerFactory"></param>
 /// <param name="logger"></param>
 public DefaultRabbitMQEventBus(IRabbitMQPersistentConnection persistentConnection, IServiceProvider serviceProvider, IEventHandlerModuleFactory eventHandlerFactory, ILogger <DefaultRabbitMQEventBus> logger)
 {
     _persistentConnection = persistentConnection ?? throw new ArgumentNullException(nameof(persistentConnection));
     _serviceProvider      = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _eventHandlerFactory  = eventHandlerFactory ?? throw new ArgumentNullException(nameof(eventHandlerFactory));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="app"></param>
        /// <param name="moduleOptions"></param>
        public static void RabbitMQEventBusModule(this IApplicationBuilder app, Action <RabbitMQEventBusModuleOption> moduleOptions)
        {
            IEventHandlerModuleFactory   factory      = app.ApplicationServices.GetRequiredService <IEventHandlerModuleFactory>();
            RabbitMQEventBusModuleOption moduleOption = new RabbitMQEventBusModuleOption(factory, app.ApplicationServices);

            moduleOptions?.Invoke(moduleOption);
        }
예제 #3
0
 public RabbitMqCore(Container ioc, IPersistentConnection persistentConnection, IEventHandlerModuleFactory eventHandlerFactory)
 {
     Connection = (PersistentConnection)persistentConnection;
     Ioc        = ioc;
 }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="handlerFactory"></param>
 public RabbitMQEventBusModuleOption(IEventHandlerModuleFactory handlerFactory, IServiceProvider applicationServices)
 {
     this.handlerFactory = handlerFactory ?? throw new ArgumentNullException(nameof(handlerFactory));
     ApplicationServices = applicationServices;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="handlerFactory"></param>
 public RabbitMQEventBusModuleOption(IEventHandlerModuleFactory handlerFactory)
 {
     this.handlerFactory = handlerFactory ?? throw new ArgumentNullException(nameof(handlerFactory));
 }