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.

RavenDB Persistence Upgrade from 6 to 7

Component: RavenDB Persistence

Support for RavenDB.Client version 5.2 and higher

Starting with NServiceBus.RavenDB version 7.0.0 RavenDB.Client version 5.2.1 or higher is required. For more information about the client and server changes refer to the official RavenDB migration guide.

Pessimistic concurrency

Up to and including version 6.5, the persistence uses optimistic concurrency control by default when updating or deleting saga data. In most cases pessimistic concurrency control will improve performance, but in some edge cases optimistic concurrency control can be much faster. It is recommended to performance test if upgrading might cause issues. To enable optimistic concurrency use:

var persistence = endpointConfiguration.UsePersistence<RavenDBPersistence>();
var sagas = persistence.Sagas();
sagas.UseOptimisticLocking();

Outbox cleaner disabled by default

Starting with NServiceBus.RavenDB version 6.3, it is recommended to rely on document expiration for outbox cleanup. The outbox cleaner is disabled by default from version 7. If the cleaner was previously disabled as shown in the following snippet, the code can be safely removed.

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

For more information, refer to the outbox cleanup guidance.

Cluster-wide transactions

Cluster-wide transactions are supported, enabling the use of RavenDB clusters and database groups replicated across multiple nodes. To turn on cluster-wide transaction support use the following configuration:

var persistence = endpointConfiguration.UsePersistence<RavenDBPersistence>();
persistence.EnableClusterWideTransactions();

Gateway deduplication storage

Starting with NServiceBus.RavenDB version 6.2.0, the built-in gateway API is obsolete and using it will produce the following message:

RavenDB gateway persistence has been moved to the NServiceBus.Gateway.RavenDB dedicated package. Will be treated as an error from version 7.0.0. Will be removed in version 8.0.0.

To migrate to the new gateway API:

Related Articles