Exemplo n.º 1
0
 public void Initialize(
     [NotNull] ExchangeDeclareConfiguration exchange,
     [NotNull] QueueDeclareConfiguration queue,
     string connectionName = null)
 {
     Exchange       = Check.NotNull(exchange, nameof(exchange));
     Queue          = Check.NotNull(queue, nameof(queue));
     ConnectionName = connectionName;
     Timer.StartAsync().Wait();
 }
Exemplo n.º 2
0
        public IRabbitMqConsumer Create(
            ExchangeDeclareConfiguration exchange,
            QueueDeclareConfiguration queue,
            string connectionName = null)
        {
            var consumer = ServiceScope.ServiceProvider.GetRequiredService <RabbitMqConsumer>();

            consumer.Initialize(exchange, queue, connectionName);
            return(consumer);
        }