我正在尝试DocumentStore.ApiKey在 NServiceBus 3.2.3 中设置 RavenDB。根据这个线程,这不能通过 NSB 3.2.3 中使用的 RavenDB 版本直接从连接字符串中读取。
NSB 中的DocumentStore实例注册为IDocumentStore,这意味着我不能使用这样的自定义操作,因为IDocumentStore它不会暴露ApiKey:
Configure.With()
.DefaultBuilder()
.RavenPersistence()
.RunCustomAction(() =>
Configure.Instance.Configurer
.ConfigureProperty<IDocumentStore>(store => store.ApiKey, "my-api-key"));
允许RavenPersistence我提供IDocumentStore. 有什么办法可以设置ApiKey吗?