public RabbitMQEventBusEngine(IOptions <RabbitMQEngineOptions> options, ILoggerFactory loggerFactory, IRabbitMQConnectionManager connectionManager, IRedisDatabase redis)
        {
            _logger            = loggerFactory.CreateLogger <RabbitMQEventBusEngine>();
            _options           = options.Value;
            _connectionManager = connectionManager;
            _redis             = redis;

            //publish
            ILogger publishTaskManagerLogger = loggerFactory.CreateLogger <PublishTaskManager>();

            foreach (RabbitMQConnectionSetting connectionSetting in _options.ConnectionSettings)
            {
                _publishManagers.Add(connectionSetting.BrokerName, new PublishTaskManager(connectionSetting, _connectionManager, _redis, publishTaskManagerLogger));
            }

            //publish history
            ILogger historyTaskManagerLogger = loggerFactory.CreateLogger <HistoryTaskManager>();

            foreach (RabbitMQConnectionSetting connectionSetting in _options.ConnectionSettings)
            {
                _historyManager.Add(connectionSetting.BrokerName, new HistoryTaskManager(connectionSetting, _connectionManager, _redis, historyTaskManagerLogger));
            }

            //Consume
            _consumeTaskManagerLogger = loggerFactory.CreateLogger <ConsumeTaskManager>();
        }
Esempio n. 2
0
 public RabbitMQConnectionManager(IOptions <RabbitMQEngineOptions> options, ILogger <RabbitMQConnectionManager> logger)
 {
     _logger  = logger;
     _options = options.Value;
 }