IPCConnectedFactoryExchange / CFX

Apache License 2.0
79 stars 71 forks source link

Retrieve garbage data from the OnMalformedMessageReceived event if the malformed message has been compressed using gzip. #191

Open bruce8300323 opened 1 year ago

bruce8300323 commented 1 year ago

I encountered a problem while subscribing to the OnMalformedMessageReceived event and receiving an unreadable message. Consequently, I had no clue how to troubleshoot it.

The message from OnMalformedMessageReceived was decoded as UTF-8 without checking the ContentEncoding property of the AMQP.Message. As a result, I obtained garbage data when the content was encoded using gzip.

Is it possible to check the ContentEncoding first and then decode the message body? Alternatively, wrapping the AMQP.Message and passing to the subscriber?