This is part of the NServiceBus Upgrade Guide from Version 7 to 8, which also includes the following individual upgrade guides for specific components:
Feature Details
- Upgrading the data bus from version 7 to 8
- Dependency Injection changes
- Upgrade NServiceBus downstreams from Version 7 to 8
- Upgrading message contracts from Version 7 to 8
- Upgrade NServiceBus pipeline extensions from Version 7 to 8
- Transport configuration changes
Transports
- AmazonSQS Transport Upgrade Version 5 to 6
- Azure Service Bus Transport Upgrade Version 2 to 3
- Azure Storage Queues Transport Upgrade Version 10 to 11
- MSMQ Transport Upgrade Version 1 to 2
- MSMQ Transport Upgrade Version 2 to 2.0.4
- RabbitMQ Transport Upgrade Version 7 to 8
- SQL Server Transport Upgrade Version 6 to 7
Persistence
- Cosmos DB Persistence Upgrade from 1 to 2
- NHibernate Persistence Upgrade Version 8 to 9
- RavenDB Persistence Upgrade from 7 to 8
- SQL Persistence Upgrade Version 6 to 7
Hosting
Other
Configuring SQL Server transport
To use the SQL Server transport for NServiceBus, create a new instance SqlServerTransport
and pass it to the EndpointConfiguration.
method.
Instead of:
var transport = endpointConfiguration.UseTransport<SqlServerTransport>();
transport.ConnectionString(connectionString);
Use:
var transport = new SqlServerTransport(connectionString);
endpointConfiguration.UseTransport(transport);
The existing API surface with UseTransport
is supported via a shim API to ease migration. However, it is recommended to switch to the new transport configuration API to prepare for future upgrades of NServiceBus.
Configuration options
The SQL Server transport configuration options have moved to the SqlServerTransport
class. See the following table for further information:
Version 6 configuration option | Version 7 configuration option |
---|---|
CreateMessageBodyComputedColumn | CreateMessageBodyComputedColumn |
DefaultSchema | DefaultSchema |
NativeDelayedDelivery | DelayedDelivery |
PurgeExpiredMessagesOnStartup | ExpiredMessagesPurger.PurgeOnStartup |
WithPeekDelay | QueuePeeker |
SubscriptionSettings | Subscriptions |
TimeToWaitBeforeTriggeringCircuitBreaker | TimeToWaitBeforeTriggeringCircuitBreaker |
TransactionScopeOptions | TransactionScope |
UseSchemaForEndpoint | UseSchemaForEndpoint on RoutingSettings |
UseCatalogForEndpoint | UseCatalogForEndpoint on RoutingSettings |
UseSchemaForQueue | SchemaAndCatalog.UseSchemaForQueue |
UseCatalogForQueue | SchemaAndCatalog.UseCatalogForQueue |
UseCustomSqlConnectionFactory | constructor argument |
Timeout manager
The timeout manager is removed from core which makes timeout manager backward-compatibility mode obsolete. If backward-compatibility mode is enabled, these APIs must be removed.
WithPeekDelay replaced by QueuePeeker
In version 6 of the transport, the message peek delay can be defined using the WithPeekDelay
configuration option. The configuration setting has moved to a more generic QueuePeeker
transport property that allows configuration of other parameters related to message peeking.
UseSchemaForEndpoint and UseCatalogForEndpoint do not affect the local endpoint
In version 6 of the transport, UseSchemaForEndpoint
and UseCatalogForEndpoint
affected the local endpoint address. In version 7, this is no longer the case. Calling one of the methods for local endpoint throws and exception and should be replaced with UseSchemaForQueue
and UseCatalogForQueue
calls.
var endpointName = "EndpointName";
var endpointConfiguration = new EndpointConfiguration(endpointName);
var transport = new SqlServerTransport("connectionString");
transport.SchemaAndCatalog.UseSchemaForQueue(endpointName, "schema");
transport.SchemaAndCatalog.UseCatalogForQueue(endpointName, "catalog");
endpointConfiguration.UseTransport(transport);