Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Latest commit

 

History

History
34 lines (23 loc) · 1.74 KB

README.md

File metadata and controls

34 lines (23 loc) · 1.74 KB

MassTransit.RavenDbIntegration

RavenDb Saga persistence for MassTransit 5

az-github MyGet Build Status NuGet

Installation

The library is published on nuget.org.

Use Install-Package MassTransit.RavenDbIntegration to install it.

Usage

When you initialize your document store, call store.RegisterSagaIdConvention(); after the initialization.

RavenDbSagaRepository<TSaga> constructor needs IDocumentStore instance as the only parameter.

Important

RavenDb is a document database with fully consistent writes and eventually consistent queries. It takes some time for RavenDb to update query index and during this time indexes are stale. MassTransit uses two types of correlation for sagas:

  • Correlation by id using CorrelateById method and Guid as identity type. In such case the repository will fetch saga document by its identity and it will be always consistent.

  • Correlation by other attributes using CorrelateBy method and a LINQ expression. For this type of correlation, the repository will run a query. RavenDb will create an index automatically but the index will be stale for some time. This means that for sagas with high traffic this persistence method is not suiable since you will get misfires. This is especially valid if you use composite events. You can improve the performance, you can create static indexes but still, for sagas where many events can come at the same saga instance at the same time, this persistence method is not suitable.