示例#1
0
 public RabbitMQBusService(
     IHostApplicationLifetime appLifetime,
     IOptionsMonitor <RabbitMQBusOptions> options)
 {
     _appLifetime = appLifetime;
     _options     = options.CurrentValue;
     if (string.IsNullOrWhiteSpace(_options.ConnectionString))
     {
         throw new Exception("Missing connection string.");
     }
 }
示例#2
0
 public RabbitMQBusService(
     IHostApplicationLifetime appLifetime,
     ILogger <RabbitMQBusService> logger,
     IOptionsMonitor <RabbitMQBusOptions> options)
 {
     _appLifetime = appLifetime;
     _logger      = logger;
     _options     = options.CurrentValue;
     if (string.IsNullOrWhiteSpace(_options.ConnectionString))
     {
         _logger.LogError("RabbitMQ connection string is missing.");
         throw new Exception("Missing connection string.");
     }
 }