在NServiceBus 3.2.3中设置RavenDB ApiKey

在NServiceBus 3.2.3中设置RavenDB ApiKey,nservicebus,api-key,ravenhq,Nservicebus,Api Key,Ravenhq,我正在尝试在NServiceBus 3.2.3中设置RavenDBDocumentStore.ApiKey。因此,NSB 3.2.3中使用的RavenDB版本无法直接从连接字符串中读取 NSB中的DocumentStore实例注册为IDocumentStore,这意味着我不能使用像这样的自定义操作,因为IDocumentStore不公开ApiKey: Configure.With() .DefaultBuilder() .RavenPersistence() .RunCu

我正在尝试在NServiceBus 3.2.3中设置RavenDB
DocumentStore.ApiKey
。因此,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"));
Configure.With()
.DefaultBuilder()
.RavenPersistence()
.RunCustomAction(()=>
Configure.Instance.Configurer
.ConfigureProperty(store=>store.ApiKey,“我的api密钥”);

RavenPersistence
扩展似乎并没有过载,它允许我提供一个
IDocumentStore
。是否有任何方法可以设置
ApiKey

我们将Raven客户端内部化,因此您无法设置该属性。想到的唯一解决办法是使用仅核心版本的nservicebus(这将使您在问题中提到的代码正常工作)。NSB的开发版本已升级到Raven 960,因此另一个选项是升级到nservicebus的CI版本(http://builds.nservicebus.com/guestAuth/app/nuget/v1/FeedService.svc)

谢谢安德烈亚斯。现在是:)