diff --git a/CFX/CFX.csproj b/CFX/CFX.csproj index 744b7cae..f1c19867 100644 --- a/CFX/CFX.csproj +++ b/CFX/CFX.csproj @@ -3,7 +3,7 @@ netstandard1.6;net8.0;netcoreapp3.1;net462 CFX.CFXSDK - 2.0.3 + 2.0.5 IPC CFX Committee IPC Connected Factory Exchange Open Source Software Development Kit false @@ -17,9 +17,9 @@ git https://github.com/IPCConnectedFactoryExchange/CFX.git images/CFX_Logo.png - 2.0.3 - 2.0.3.0 - 2.0.3.0 + 2.0.5 + 2.0.5.0 + 2.0.5.0 true CFXStrongNameKey.snk true diff --git a/CFX/Transport/AmqpUtilities.cs b/CFX/Transport/AmqpUtilities.cs index 80c460ee..4c7d9038 100644 --- a/CFX/Transport/AmqpUtilities.cs +++ b/CFX/Transport/AmqpUtilities.cs @@ -153,9 +153,13 @@ public static List EnvelopesFromMessage(Message msg) internal static string StringFromEnvelopes(Message msg) { - if (msg?.Body is byte[]) + if (msg?.Body is byte[] array) { - return Encoding.UTF8.GetString(msg.Body as byte[]); + if (string.Equals(msg.Properties.ContentEncoding, "gzip", StringComparison.OrdinalIgnoreCase)) + { + array = Decode(array, CFXCodec.gzip); + } + return Encoding.UTF8.GetString(array); } else if (msg?.Body is string) { @@ -257,6 +261,10 @@ public static string MessagePreview(Message message, int count = 200) string result = ""; try { + if (string.Equals(message.Properties.ContentEncoding, "gzip", StringComparison.OrdinalIgnoreCase)) + { + bt = Decode(bt, CFXCodec.gzip); ; + } result = Encoding.UTF8.GetString(bt); if (result.Length > count) result = result.Substring(0, count); }