在 NServiceBus 3.2.3 中设置 RavenDB ApiKey [英] Setting RavenDB ApiKey in NServiceBus 3.2.3

查看:20
本文介绍了在 NServiceBus 3.2.3 中设置 RavenDB ApiKey的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 NServiceBus 3.2.3 中设置 RavenDB DocumentStore.ApiKey.根据此线程,无法直接从NSB 3.2.3 中使用的 RavenDB 版本的连接字符串.

I am trying to set the RavenDB DocumentStore.ApiKey in NServiceBus 3.2.3. According to this thread, this is not able to be read directly from the connection string by the version of RavenDB used in NSB 3.2.3.

NSB 中的 DocumentStore 实例注册为 IDocumentStore,这意味着我不能使用这样的自定义操作,因为 IDocumentStore 不公开APIKey:

The DocumentStore instance in NSB is registered as an IDocumentStore, which means I cannot use a custom action like this as IDocumentStore does not expose ApiKey:

Configure.With()
    .DefaultBuilder()
    .RavenPersistence()
    .RunCustomAction(() => 
        Configure.Instance.Configurer
        .ConfigureProperty<IDocumentStore>(store => store.ApiKey, "my-api-key"));

RavenPersistence 扩展似乎没有过载,允许我提供 IDocumentStore.有什么办法可以设置 ApiKey 吗?

There doesn't seem to be overload of the RavenPersistence extension that allows me to supply an IDocumentStore. Is there any way I can set the ApiKey?

推荐答案

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

We internalize the Raven client so there is no way for you to set that property. The only work around that comes to mind is to use the core only version of nservicebus (that would make the code you mention in your question to work properly) The development version of NSB has been upgraded to Raven 960 so another option would be to upgrade to the CI version of NServiceBus (http://builds.nservicebus.com/guestAuth/app/nuget/v1/FeedService.svc)

这篇关于在 NServiceBus 3.2.3 中设置 RavenDB ApiKey的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆