Sanitization

Azure Service Bus entities have path and name rules that limit the allowed characters and maximum length. NServiceBase derives entity names from endpoint and event names; these derived names may fail Azure Service Bus validation. Sanitization is a process that modifies entity names so that the broker can use them.

In Versions 6 and below sanitization was performed by default and the MD5 algorithm was used to truncate entity names. In Versions 7 and above, the sanitization has to be enabled and configured explicitly.

In version 6.4.0 NamingConventions class was introduced to customize sanitization. The class is obsoleted. Instead, implement a custom sanitization strategy.

New Configuration API

In Versions 6 and below the transport was configured using an XML configuration section called AzureServiceBusQueueConfig. This section has been removed in favor of a more granular, code based configuration API.

The new configuration API is accessible through extension methods on the UseTransport<AzureServiceBusTransport>() extension point in the endpoint configuration. Refer to the Full Configuration Page for more details.

Setting The Connection String

Setting the connection string can still be done using the ConnectionString extension method:

Setting Entity Property Values

The other configuration properties found on AzureServiceBusQueueConfig were related to the configuration of Azure Service Bus entities. Even though the name implied differently, these settings were not only applied to queues, but also to topics and subscriptions.

In the new configuration API the settings for queues, topics and subscriptions can be configured individually using the Queues(), Topics() and Subscriptions() extension points.

For example the lock duration on a queue can be configured using the LockDuration setting: