Getting Started

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();

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();

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>();

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