private IModel CreateChannel()
        {
            _rabbitMqConnection.TryConnection();

            var channel = _rabbitMqConnection.CreateModel();

            channel.ExchangeDeclare(exchange: _exchangeName, type: ExchangeType.Direct);
            channel.QueueDeclare(_routingKey, true, false, false, null);
            channel.QueueBind(_routingKey, _exchangeName, _routingKey, null);

            return(channel);
        }
Esempio n. 2
0
 public static void UseRabbitMqConnectionListener(
     this IApplicationBuilder app,
     IRabbitMqConnection rabbitMqConnection)
 {
     rabbitMqConnection.TryConnection();
 }