Simple SQL Server Transport Usage

Component: SQL Server Transport
NuGet Package NServiceBus.SqlServer (4-pre)
Target NServiceBus Version: 7.x
This page targets a pre-release version and is subject to change prior to the final release.

Prerequisites

An instance of SQL Server Express is installed and accessible as .\SqlExpress.

At startup each endpoint will create its required SQL assets including databases, tables and schemas.

The database created by this sample is NsbSamplesSqlTransport.

Running the project

  1. Start both the Sender and Receiver projects
  2. At startup Sender will send a message to Receiver.
  3. Receiver will handle the message.

Code Walk-through

Configure the SQL Server Transport

var transport = endpointConfiguration.UseTransport<SqlServerTransport>();
var connection = @"Data Source=.\SqlExpress;Database=SqlServerSimple;Integrated Security=True;Max Pool Size=100";
transport.ConnectionString(connection);

Related Articles


Last modified