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.Start(); }
public IRabbitMqMessageConsumer Create( ExchangeDeclareConfiguration exchange, QueueDeclareConfiguration queue, string connectionName = null) { var consumer = ServiceScope.ServiceProvider.GetRequiredService <RabbitMqMessageConsumer>(); consumer.Initialize(exchange, queue, connectionName); return(consumer); }