Message Deserializing

Modified on Thu, 17 Feb 2022 at 02:58 PM

The data you receive via RabbitMQ arrives as an array of bytes. The array of bytes has to be deserialized in order for it to become readable. The deserialization method depends on the format that you have selected to get the data in. If the format you have selected is JSON/XML – Simply decode the message as following:

string deserializedMessage = Encoding.UTF8.GetString(eventArgs.Body);

If you are using the Binary format, you will need to perform deserialization using Protocol Buffers.

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article