This is part of the NServiceBus Upgrade Guide from Version 5 to 6, which also includes the following individual upgrade guides for specific components:
Feature Details
- Assembly Scanning Changes in NServiceBus Version 6
- No Async Suffix
- Dependency Injection Changes in NServiceBus Version 6
- Deprecated TransportMessage in NServiceBus Version 6
- Endpoint API changes in NServiceBus Version 6
- Extension Seam Changes in NServiceBus Version 6
- Migrate handlers and sagas to Version 6
- Header API changes in NServiceBus Version 6
- Messaging Changes in NServiceBus Version 6
- Moving away from IBus in Version 6
- Recoverability Changes in Version 6
- Serialization Changes in NServiceBus Version 6
- Subscription Changes in NServiceBus Version 6
- Transaction Configuration Changes in NServiceBus Version 6
Transports
- Azure Service Bus Transport (Legacy) Upgrade Version 6 to 7
- RabbitMQ Transport Upgrade Version 3 to 4
- SQL Server Transport Upgrade Version 2 to 3
- SQL Server Transport Upgrade - Supporting Unicode in Headers
Persistence
- Upgrade from NServiceBus Azure Version 6
- NHibernate Persistence Upgrade Version 6 to 7
- NHibernate Persistence - Resolving incorrect timeout table indexes
- RavenDB Persistence Upgrade from 3 to 4
Hosting
Other
- Moving to the DataBus AzureBlobStorage Package
- Azure Cloud Services Host Upgrade Version 6 to 7
- NServiceBus.Azure package deprecated
- Gateway Upgrade Version 1 to 2
- NServiceBus Testing Upgrade Version 5 to 6
- Callback Changes in NServiceBus Version 6
- Migrating the distributor to use sender-side distribution
- Tool and Helper Changes in NServiceBus Version 6
BinarySerializer deprecated
The BinarySerializer is deprecated. Use one of the supported serializers or an external serializer.
No dependency injection for IMessageSerializer
The IMessageSerializer
instances are now produced by a factory (as described in this article) instead of being resolved through dependency injection.
Built-in serializers are internal
Built-in JSON and XML serializers are internal starting with NServiceBus version 6. If a custom serializer depends on one of these serializers, the code will need to be copied.
Standardized XML Serialization
Handling of null types within the XML serializer now conforms to the W3C Specification by using the xsi:nil="true"
attribute.
This change is backward compatible and will have no impact on communication between older versions of endpoints and newer versions. Older versions will be able to communicate with newer versions and vice versa.
Given the following class:
public class MessageWithNullable : IMessage
{
public string FirstName { get; set; }
public DateTime? BirthDate { get; set; } //Nullable DateTime property
}
A null BirthDate
would result in a message in the following:
// For NServiceBus version 6.x
<MessageWithNullable
xmlns="http://tempuri.net/NServiceBus.Serializers.XML.Test">
<FirstName>FirstName</FirstName>
<BirthDate xsi:nil="true"></BirthDate>
</MessageWithNullable>
// For NServiceBus version 5.x
<MessageWithNullable
xmlns="http://tempuri.net/NServiceBus.Serializers.XML.Test">
<FirstName>FirstName</FirstName>
<BirthDate>null</BirthDate>
</MessageWithNullable>
External integration systems need to ensure compatibility when receiving messages in the new format.
BSON serializer deprecated
The BSON serializer built into the core has been removed. Use the Newtonsoft serializer as a replacement. Also see the Newtonsoft BSON sample.