NServiceBus takes instances of .NET objects (messages, events and commands) and then sends/receives them over a specified Transport. As part of this the object needs to be serialized and deserialized. To achieve this NServiceBus uses Serializers.
The Newtonsoft JSON Serializer provides an effective general-purpose serializer appropriate for most use cases based on the ubiquitous Json.NET package. The Newtonsoft package provides a good combination of compactness, human readability, and performance. Other serializers are supported in order to enable specific performance or integration requirements.
- JSON/BSON (deprecated in Versions 7 and above)
- Binary (deprecated in Versions 6 and above)
The default serializer used in NServiceBus projects is the custom XmlSerializer.
The pages dedicated to particular Serializers show how to configure the endpoint to use each of them. Unless explicitly configured otherwise, NServiceBus will use XmlSerializer for serializing and deserializing all messages.
In order to register community run serializer or custom serializer, refer to the Custom serializers - Register the serializer section.