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

查看:85
本文介绍了在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天全站免登陆