Skip to content

Commit

Permalink
chore: remove redundant ExchangeDeclare call
Browse files Browse the repository at this point in the history
  • Loading branch information
tnotheis committed Dec 19, 2024
1 parent 567cc4a commit 3fc84e2
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3fc84e2

Please sign in to comment.