AI agents: use the documentation index at llms.txt to locate machine-readable pages. This section is indexed by https://docs.particular.net/persistence/llms.txt. The markdown version of this page is served as plain text. An MCP server at /mcp serves the same content via the search_docs and read_doc tools; it is read-only and needs no credentials. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md. They are served as text/plain because some retrieval backends reject text/markdown.

Outbox with RavenDB persistence

Target Version:
NServiceBus 10.x

The Outbox feature requires persistence in order to store messages and enable deduplication.

Storage format

The persister stores outbox data for all endpoints in a collection called OutboxRecords. To separate data for individual endpoints, stored documents will have their endpoint name embedded in the document ID using the following format: Outbox/{Endpoint-name}/{Message-id}.

Deduplication record lifespan

The RavenDB persistence retains deduplication records for 7 days by default and runs the cleanup operation every minute.

These settings can be modified by specifying the desired values in the settings dictionary:

var outboxSettings = endpointConfiguration.EnableOutbox();
outboxSettings.SetTimeToKeepDeduplicationData(TimeSpan.FromDays(7));

Starting with NServiceBus.RavenDB version 7.0, cleanup is disabled by default and it is recommended to rely on document expiration instead.

If document expiration cannot be used it is possible to enable the outbox purging by specifying:

var outboxSettings = endpointConfiguration.EnableOutbox();
outboxSettings.SetFrequencyToRunDeduplicationDataCleanup(TimeSpan.FromMinutes(1));

If document expiration cannot be used, to improve efficiency it is advised to run cleanup on only one endpoint instance per RavenDB database, by explicitely disabling clean up on all other endpoint instances:

var outbox = endpointConfiguration.EnableOutbox();
outbox.SetFrequencyToRunDeduplicationDataCleanup(Timeout.InfiniteTimeSpan);

Related Articles

  • Outbox
    Use the NServiceBus Outbox pattern to ensure message consistency and prevent duplicate message processing in distributed systems.