For the complete documentation index, see llms.txt. This section of documentation is indexed by https://docs.particular.net/persistence/llms.txt. Here is the markdown version of this page. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md.

Outbox with DynamoDB persistence

Target Version:
NServiceBus 10.x

Configure the Outbox table

The Outbox data table can be configured via:

var outboxConfiguration = endpointConfiguration.EnableOutbox();
outboxConfiguration.UseTable(new TableConfiguration
{
    TableName = "MyOutboxTable",
    PartitionKeyName = "MyOutboxPartitionKey",
    SortKeyName = "MyOutboxSortKey",
    TimeToLiveAttributeName = "MyOutboxTtlAttribute"
});

The Outbox uses time-to-live to ensure cleanup of successfully processed message, therefore, the Outbox table requires a TableConfiguration.TimeToLiveAttributeName value to be set. When installers are enabled, NServiceBus will create the table with the proper time-to-live configuration, otherwise users will need to ensure that the table is properly configured.

Outbox cleanup

When the Outbox successfully processes a message, messages with the same message ID will be ignored (deduplicated) for 7 days by default. To customize the deduplication timespan, use the following API:

var outboxConfiguration = endpointConfiguration.EnableOutbox();
outboxConfiguration.SetTimeToKeepDeduplicationData(TimeSpan.FromDays(14));

Related Articles

  • AWS DynamoDB persistence
    How to use NServiceBus with AWS DynamoDB.
  • Outbox
    Use the NServiceBus Outbox pattern to ensure message consistency and prevent duplicate message processing in distributed systems.