Binding queue using existing cosumerChannel

This commit is contained in:
Alan.Yu 2021-07-05 21:56:09 +08:00
parent 8bb15ce987
commit c2e53ed5f1

View File

@ -144,14 +144,11 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
_persistentConnection.TryConnect(); _persistentConnection.TryConnect();
} }
using (var channel = _persistentConnection.CreateModel()) _consumerChannel.QueueBind(queue: _queueName,
{
channel.QueueBind(queue: _queueName,
exchange: BROKER_NAME, exchange: BROKER_NAME,
routingKey: eventName); routingKey: eventName);
} }
} }
}
public void Unsubscribe<T, TH>() public void Unsubscribe<T, TH>()
where T : IntegrationEvent where T : IntegrationEvent