Setting RavenDB ApiKey in NServiceBus 3.2.3

淺唱寂寞╮ 提交于 2019-12-24 20:40:24

问题


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.

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"));

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?


回答1:


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)



来源:https://stackoverflow.com/questions/11240353/setting-ravendb-apikey-in-nservicebus-3-2-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!