From 3fc84e246ff9d1b20ee72b973a1948da6c3f07d3 Mon Sep 17 00:00:00 2001 From: Timo Notheisen Date: Thu, 19 Dec 2024 13:52:57 +0100 Subject: [PATCH] chore: remove redundant ExchangeDeclare call --- .../EventBus/RabbitMQ/EventBusRabbitMQ.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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,