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"
});
When using the same table for Saga and Outbox data, use the shared table configuration API instead.
The Outbox uses time-to-live to clean up records of successfully processed messages, so the Outbox table requires a TableConfiguration. value. When installers are enabled, NServiceBus creates the table with the correct time-to-live configuration. Otherwise, the table must be created and configured before the endpoint starts.
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));
Increasing the deduplication timeframe increases the amount of data stored in the Outbox table.
For the read and write capacity the Outbox consumes per message, see capacity planning.