0
votes

I am using NServiceBus hosted in my own process along with RavenDB also hosted in the same process using RavenDB.Embedded.

This combo has worked without any problems when I was using NServiceBus 4.6.5, however I upgraded to NServiceBus 5.0.0 and updated the configuration to use the new configuration api.

Everything builds and I can send messages to an endpoint which are received and a saga instance is constructed.

However, NServiceBus then throws an exception with the message:

No saga persister configured. Please configure a saga persister if you want to use the nservicebus saga support

I was using the following configuration successfully with NServiceBus 4.6.5:

Configure.With()
         .DefaultBuilder()
         .RavenPersistenceWithStore(DocumentStore)

With NServiceBus 5.0.0 I have tried the following configurations without any luck:

1.

configuration.UsePersistence<RavenDBPersistence>()
             .SetDefaultDocumentStore(DocumentStore);

2.

configuration.UsePersistence<RavenDBPersistence>()
             .SetDefaultDocumentStore(DocumentStore)
             .UseDocumentStoreForSagas(DocumentStore);

3.

configuration.UsePersistence<RavenDBPersistence>()
             .SetDefaultDocumentStore(DocumentStore)
             .UseDocumentStoreForSagas(DocumentStore)
             .UseDocumentStoreForSubscriptions(DocumentStore)
             .UseDocumentStoreForTimeouts(DocumentStore);

and all three with and without:

configuration.EnableFeature<RavenDbSagaStorage>();

If I use InMemoryPersistence then everything works great.

Has anyone else experienced this issue with RavenDB.Embedded combined with NServiceBus 5.0.0?

1

1 Answers

1
votes

I got this to work again, what I was missing was:

configuration.AssembliesToScan
            (typeof(SomeMessage).Assembly,
             typeof(SomeHandler).Assembly,
             typeof(RabbitMQTransport).Assembly,
             typeof(RavenDBPersistence).Assembly);

Should have mentioned in the question that I already set the config to scan my messages and handlers assemblies along with the assembly of RabbitMQTransport.

I didn't need to scan the following assembly previously but do have to now apparently:

typeof(RavenDBPersistence).Assembly