Binding queue using existing cosumerChannel (#1716)

Co-authored-by: Alan.Yu <alan.yu@hidglobal.com>
This commit is contained in:
AlanYu 2021-07-07 15:34:25 +08:00 committed by GitHub
parent 8bb15ce987
commit 5c57b8c3f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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