From b9bc1aac2302508d2df923d93849a858ce105871 Mon Sep 17 00:00:00 2001 From: Richard Phillips Date: Thu, 2 Apr 2026 16:35:00 +0100 Subject: [PATCH] add exchange type to be set to match existing exchanges --- changelog.md | 3 +++ src/Linn.Common.Messaging.RabbitMQ.csproj | 2 +- src/RabbitChannelConfiguration.cs | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index f252fad..71fdd15 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # Changelog +## [4.0.1] - 2026-04-02 +### *Changes +- Add optional exchangeType parameter to RabbitChannelConfiguration ## [4.0.0] - 2026-03-10 ### *Changes (VERY Breaking)* - Upgrade to RabbitMQ.Client to v7, target .net9 diff --git a/src/Linn.Common.Messaging.RabbitMQ.csproj b/src/Linn.Common.Messaging.RabbitMQ.csproj index 071769a..ea88340 100644 --- a/src/Linn.Common.Messaging.RabbitMQ.csproj +++ b/src/Linn.Common.Messaging.RabbitMQ.csproj @@ -5,7 +5,7 @@ enable Linn.Common.Messaging.RabbitMQ Linn.Common.Messaging.RabbitMQ - 4.0.0 + 4.0.1 enable diff --git a/src/RabbitChannelConfiguration.cs b/src/RabbitChannelConfiguration.cs index 4937149..d5aa9c3 100644 --- a/src/RabbitChannelConfiguration.cs +++ b/src/RabbitChannelConfiguration.cs @@ -11,7 +11,8 @@ public class RabbitChannelConfiguration( string? dlqName = null, string? dlxName = null, bool createProducerChannel = true, - bool createConsumerChannel = true) + bool createConsumerChannel = true, + string exchangeType = ExchangeType.Direct) : IAsyncDisposable { private readonly string dlqName = string.IsNullOrEmpty(dlqName) ? queueName : dlqName; @@ -60,7 +61,7 @@ public async Task InitializeAsync(CancellationToken cancellationToken = default) await setupChannel.ExchangeDeclareAsync( this.Exchange, - ExchangeType.Direct, + exchangeType, durableExchange, cancellationToken: cancellationToken);