diff --git a/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/EventBusRabbitMQ.cs b/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/EventBusRabbitMQ.cs index 08c2c3f37d..ab0df51145 100644 --- a/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/EventBusRabbitMQ.cs +++ b/BuildingBlocks/src/BuildingBlocks.Infrastructure/EventBus/RabbitMQ/EventBusRabbitMQ.cs @@ -54,8 +54,6 @@ public void Dispose() public async Task StartConsuming() { - await _consumerChannel!.ExchangeDeclareAsync(EXCHANGE_NAME, "direct"); - if (_consumer is null) { throw new Exception("Cannot start consuming without a consumer set."); @@ -162,7 +160,7 @@ private async Task CreateConsumerChannel() _consumerChannel = await _persistentConnection.CreateChannel(); - await _consumerChannel.ExchangeDeclareAsync(EXCHANGE_NAME, "direct"); // TODO: why declare again? This is already up in StartConsuming + await _consumerChannel.ExchangeDeclareAsync(EXCHANGE_NAME, "direct"); await _consumerChannel.QueueDeclareAsync(_queueName, durable: true,