NServiceBus 5 RavenDBPersistence使用EmbeddableDocumentStore设置D
本文关键字:设置 EmbeddableDocumentStore 使用 RavenDBPersistence NServiceBus | 更新日期: 2023-09-27 18:25:53
我正在使用在我自己的进程中托管的NServiceBus,以及在同一进程中使用RavenDB.Embedded.托管的RavenDB
当我使用NServiceBus 4.6.5时,这个组合没有任何问题,但我升级到了NServiceBus 5.0.0,并更新了配置以使用新的配置api。
一切都建立起来了,我可以向端点发送消息,接收到消息,然后构建一个传奇实例。
然而,NServiceBus随后抛出一个异常,并显示消息:
未配置传奇持久器。如果你想使用nserviebus传奇支持,请配置一个传奇持久器
我在NServiceBus 4.6.5中成功地使用了以下配置:
Configure.With()
.DefaultBuilder()
.RavenPersistenceWithStore(DocumentStore)
使用NServiceBus 5.0.0,我尝试了以下配置,但没有任何运气:
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);
和所有三个有和没有:
configuration.EnableFeature<RavenDbSagaStorage>();
如果我使用InMemoryPersistence,那么一切都很好。
其他人在RavenDB.Embedded与NServiceBus 5.0.0结合使用时遇到过这个问题吗?
我又开始工作了,我缺少的是:
configuration.AssembliesToScan
(typeof(SomeMessage).Assembly,
typeof(SomeHandler).Assembly,
typeof(RabbitMQTransport).Assembly,
typeof(RavenDBPersistence).Assembly);
应该在问题中提到,我已经将配置设置为扫描我的消息和处理程序程序集以及RabbitMQTransport的程序集。
我以前不需要扫描以下组件,但现在必须扫描:
typeof(RavenDBPersistence).Assembly