From 1b9bac41a6794e66e53e688b37a26e3cf1acdf86 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Thu, 30 Mar 2023 13:04:43 +0200 Subject: [PATCH 1/2] Fix for JSON parse error on x-dead-letter-exchange argument --- Tapeti/Connection/TapetiClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tapeti/Connection/TapetiClient.cs b/Tapeti/Connection/TapetiClient.cs index ec1316b..a23c8df 100644 --- a/Tapeti/Connection/TapetiClient.cs +++ b/Tapeti/Connection/TapetiClient.cs @@ -313,7 +313,7 @@ namespace Tapeti.Connection } - private static RabbitMQArguments? ConvertJsonArguments(IReadOnlyDictionary? arguments) + private static RabbitMQArguments? ConvertJsonArguments(IReadOnlyDictionary? arguments) { if (arguments == null) return null; @@ -599,7 +599,7 @@ namespace Tapeti.Connection public bool Exclusive { get; set; } [JsonProperty("arguments")] - public Dictionary? Arguments { get; set; } + public Dictionary? Arguments { get; set; } [JsonProperty("messages")] public uint Messages { get; set; } From 3c7dc09bfff60d5339327bc565182876f85f9e70 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Thu, 30 Mar 2023 13:58:44 +0200 Subject: [PATCH 2/2] Keep arguments as string instead of bytes --- Tapeti/Connection/TapetiClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tapeti/Connection/TapetiClient.cs b/Tapeti/Connection/TapetiClient.cs index a23c8df..07e2718 100644 --- a/Tapeti/Connection/TapetiClient.cs +++ b/Tapeti/Connection/TapetiClient.cs @@ -326,7 +326,7 @@ namespace Tapeti.Connection { JTokenType.Integer => pair.Value.Value(), JTokenType.Float => pair.Value.Value(), - JTokenType.String => Encoding.UTF8.GetBytes(pair.Value.Value() ?? string.Empty), + JTokenType.String => pair.Value.Value() ?? string.Empty, JTokenType.Boolean => pair.Value.Value(), _ => throw new ArgumentOutOfRangeException(nameof(arguments)) };