Example #1
0
        public IRabbitMqMessageConsumer Create(
            ExchangeDeclareConfiguration exchange,
            QueueDeclareConfiguration queue,
            QOSConfiguration consumerConfiguration,
            string connectionName = null)
        {
            var consumer = ServiceScope.ServiceProvider.GetRequiredService <RabbitMqMessageConsumer>();

            consumer.Initialize(exchange, queue, consumerConfiguration, connectionName);
            return(consumer);
        }
Example #2
0
 public void Initialize(
     [NotNull] ExchangeDeclareConfiguration exchange,
     [NotNull] QueueDeclareConfiguration queue,
     [NotNull] QOSConfiguration consumerConfiguration,
     string connectionName = null)
 {
     Exchange = Check.NotNull(exchange, nameof(exchange));
     Queue    = Check.NotNull(queue, nameof(queue));
     ConsumerConfiguration = Check.NotNull(consumerConfiguration, nameof(consumerConfiguration));
     ConnectionName        = connectionName;
     Timer.Start();
 }