SQL Server Transport Upgrade Version 6 to 7

Component: SQL Server Transport
This page targets a pre-release version. Pre-releases are subject to change and samples are not guaranteed to be fully functional.

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<SqlServerTransprot>();
transport.ConnectionString(connectionString);

Use:

var transport = new SqlServerTransport(connectionString);
endpointConfiguration.UseTransport(transport);
The existing API surface with UseTransport<T>() is supported for NServiceBus version 8 via a shim API to ease migration to the new version. 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 optionVersion 7 configuration option
CreateMessageBodyComputedColumnCreateMessageBodyComputedColumn
DefaultSchemaDefaultSchema
NativeDelayedDeliveryDelayedDelivery
PurgeExpiredMessagesOnStartupExpiredMessagesPurger.PurgeOnStartup
WithPeekDealyQueuePeeker
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.

UseScheamForEndpoint 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


Last modified