The Outbox feature requires persistence in order to store messages and enable deduplication.
To keep track of duplicate messages, the RavenDB implementation of Outbox creates a special collection of documents called
The RavenDB implementation by default keeps deduplication records for 7 days and runs the purge every 1 minute.
These default settings can be changed by specifying new defaults in the settings dictionary:
By specifying a value of -1 (
SetFrequencyToRunDeduplicationDataCleanup the cleanup task is disabled. This can be useful when an endpoint is scaled out and instances are competing to run the cleanup task.
When the Outbox is enabled, the default transport transaction level will be set so that the endpoint does not utilize distributed transactions. As a result of this, the RavenDB persistence will alter the RavenDB DocumentStore so that it also does not enlist in distributed transactions.
Although this will automatically occur when the endpoint initializes, it's still recommended to set disable RavenDB enlistment in DTC transactions in order to be explicit:
documentStore.EnlistInDistributedTransactions = false;
When the RavenDB Outbox is enabled none of the following properties, on the RavenDB DocumentStore, should be set. They are only used by RavenDB's DTC implementation: