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); }
public static void UseRabbitMqConnectionListener( this IApplicationBuilder app, IRabbitMqConnection rabbitMqConnection) { rabbitMqConnection.TryConnection(); }