Backwards Compatibility

Component: Azure Service Bus Transport
NuGet Package NServiceBus.Transport.AzureServiceBus (2-pre)
Target NServiceBus Version: 8.x
This page targets a pre-release version and is subject to change prior to the final release.

The Azure Service Bus transport is backward compatible with the legacy Azure Service Bus transport under certain conditions.


Forwarding topology

The Azure Service Bus transport only supports the forwarding topology, an entity layout where a topic is used for publishing between the endpoints.

Single namespace

The Azure Service Bus transport only supports a single namespace.

Topic path must match

Both transports must be configured using the same topic path for publishing to work properly. This implies that the topic used by the endpoints using the Azure Service Bus transport must match the topic used by the endpoints on legacy Azure Service Bus. See bundle prefix for details.

In addition, only one topic path is supported. For publishers that are using the legacy Azure Service Bus transport version 7 or lower, the number of entities in a bundle must be restricted to one using:


Namespace alias is not used

The Azure Service Bus transport doesn't support namespace aliases.

Sanitization rules must be aligned

If the legacy transport sanitizes entity names, the sanitization logic must be updated to be compatible with the new transport.

For example, for the ValidateAndHashIfNeeded strategy, the sanitization functions must include the strategy logic to preserve the same entity names.

string HashName(string input)
    var inputBytes = Encoding.Default.GetBytes(input);
    // use MD5 hash to get a 16-byte hash of the string
    using (var provider = new MD5CryptoServiceProvider())
        var hashBytes = provider.ComputeHash(inputBytes);
        return new Guid(hashBytes).ToString();

const int MaxEntityName = 50;

transport.SubscriptionNamingConvention = n => n.Length > MaxEntityName ? HashName(n) : n;
transport.SubscriptionRuleNamingConvention = n => n.FullName.Length > MaxEntityName ? HashName(n.FullName) : n.FullName;

Last modified