Configuration

Component: Azure Storage Persistence | Nuget: NServiceBus.Azure (Version: 5.x)
Target NServiceBus Version: 4.x
Standard support for version 4.x of NServiceBus has expired. For more information see our Support Policy.

In NServiceBus.Azure the behavior of the AzureStoragePersister can be controlled by working with the appropriate configuration section(s) in the app.config or by using the code via the IProvideConfiguration adapter. Both approaches to configuring the persister can access the same configuration options.

Configuration with Configuration Section

In NServiceBus.Azure configuration can be performed using configuration sections and properties in the app.config file.

Edit
<configSections>
  <section name="AzureSubscriptionStorageConfig"
           type="NServiceBus.Config.AzureSubscriptionStorageConfig, NServiceBus.Azure" />
  <section name="AzureSagaPersisterConfig"
           type="NServiceBus.Config.AzureSagaPersisterConfig, NServiceBus.Azure" />
  <section name="AzureTimeoutPersisterConfig"
           type="NServiceBus.Config.AzureTimeoutPersisterConfig, NServiceBus.Azure" />
</configSections>
<AzureSagaPersisterConfig ConnectionString="UseDevelopmentStorage=true" />
<AzureTimeoutPersisterConfig ConnectionString="UseDevelopmentStorage=true" />
<AzureSubscriptionStorageConfig ConnectionString="UseDevelopmentStorage=true" />

Configuration Properties

Each area of the persister (Sagas, Subscriptions and Timeouts) have values that can be set or changed.

Saga Configuration

The following settings are available for changing the behavior of saga persistence section:

  • ConnectionString: Sets the connectionstring for the storage account to be used for storing saga information.
  • NServiceBus.Azure defaults to UseDevelopmentStorage=true.
  • NServiceBus.Persistence.AzureStorage Version 1 defaults to null.
  • CreateSchema: Instructs the persister to create the table automatically.
  • defaults to true.

Subscription Configuration

The following settings are available for changing the behavior of subscription persistence:

  • ConnectionString: Sets the connection string for the storage account to be used for storing subscription information.
  • NServiceBus.Azure defaults to UseDevelopmentStorage=true.
  • NServiceBus.Persistence.AzureStorage Version 1 defaults to null.
  • CreateSchema: Instructs the persister to create the table automatically.
  • defaults to true.
  • TableName: Specifies the name of the table for storing subscriptions
  • defaults to Subscription.

Timeout Configuration

The following settings are available for changing the behavior of timeout persistence:

  • ConnectionString: Sets the connectionstring for the storage account to be used for storing timeout information.
  • NServiceBus.Azure Versions 6 and below Defaults to UseDevelopmentStorage=true.
  • NServiceBus.Persistence.AzureStorage Version 1 defaults to null.
  • TimeoutManagerDataTableName: Sets the name of the table where the timeout manager stores it's internal state.
  • defaults to TimeoutManagerDataTable.
  • TimeoutDataTableName: Sets the name of the table where the timeouts themselves are stored.
  • defaults to TimeoutDataTableName.
  • CatchUpInterval: When a node hosting a timeout manager goes down, it needs to catch up with missed timeouts faster than it normally would (1 sec), this value sets the catchup interval in seconds.
  • defaults to 3600, meaning it will process one hour at a time.
  • PartitionKeyScope: The time range used as partition key value for all timeouts. For optimal performance this should be in line with the catchup interval. Data in the table defined by TimeoutDataTableName will need to be migrated when modifying PartitionKeyScope.
  • defaults to yyyMMddHH.
  • TimeoutStateContainerName: Sets the name of the container where the timeout state is stored - Added in NServiceBus.Persistence.AzureStorage Version 1.0.
  • defaults to timeoutstate.

For more information on connection string configuration see Configuring Azure Connection Strings.


Last modified