Getting Started
Architecture
NServiceBus
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

SQL Server Transport Upgrade Version 6 to 7

Configuring SQL Server transport

To use the SQL Server transport for NServiceBus, create a new instance SqlServerTransport and pass it to the EndpointConfiguration.UseTransport method.

Instead of:

var transport = endpointConfiguration.UseTransport<SqlServerTransport>();
transport.ConnectionString(connectionString);

Use:

var transport = new SqlServerTransport(connectionString);
endpointConfiguration.UseTransport(transport);

Configuration options

The SQL Server transport configuration options have moved to the SqlServerTransport class. See the following table for further information:

Version 6 configuration optionVersion 7 configuration option
CreateMessageBodyComputedColumnCreateMessageBodyComputedColumn
DefaultSchemaDefaultSchema
NativeDelayedDeliveryDelayedDelivery
PurgeExpiredMessagesOnStartupExpiredMessagesPurger.PurgeOnStartup
WithPeekDelayQueuePeeker
SubscriptionSettingsSubscriptions
TimeToWaitBeforeTriggeringCircuitBreakerTimeToWaitBeforeTriggeringCircuitBreaker
TransactionScopeOptionsTransactionScope
UseSchemaForEndpointUseSchemaForEndpoint on RoutingSettings
UseCatalogForEndpointUseCatalogForEndpoint on RoutingSettings
UseSchemaForQueueSchemaAndCatalog.UseSchemaForQueue
UseCatalogForQueueSchemaAndCatalog.UseCatalogForQueue
UseCustomSqlConnectionFactoryconstructor 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);

Related Articles