Domanda

I am trying to setup NServiceBus 3.3.5 to use centerlized RavenDB instead of running RavenDB on every application server. I am able to use NServiceBus.Persistence with Windows username/password and it works. However, I would like to use APIKeys if possible.

Works:

<add name="NServiceBus.Persistence"
     connectionString="Url=http://DBServerName:8080;Database=DBName;User=Domain\RavenDBTestUser;Password=**********;" />

Doesn't work:

<add name="NServiceBus.Persistence"
     connectionString="Url = http://DBServerName:8080/; ApiKey = NServiceBusClients/SecretKey; Database = DBName" />

I get the following error (RavenDB returns 403) when starting the service ...

FATAL 06:32:23 Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Raven.Client.IDocumentStore)' on type 'RavenTimeoutPersistence'. ---> System.InvalidOperationException ---> System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at System.Net.HttpWebRequest.GetResponse()
   at Raven.Client.Connection.HttpJsonRequest.ReadStringInternal(Func`1 getResponse) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:line 279

The user Domain\RavenDBTestUser and api-key have identical access in RavenDB. I have gone thru this and this but those are from mid-last year and about version 3.2.3. Is it still the same in 3.3.5 or am I doing something wrong?

P.S. The connection string is copied-pasted from Raven Studio so there is no typo in it.

È stato utile?

Soluzione

NServiceBus v3.3.5 still uses RavenDb v1, unfortunately I can't find much doco about the use of APIKeys in Raven v1, the only thing I found is http://ravendb.net/docs/1.0/server/bundles/authentication

The link above states that you need the "Authentication Bundle", do you have this installed?

On the other hand, NServiceBus v4 uses RavenDB v2, and from reading this page, it should be easy to set it up. NServiceBus v4 beta has just been released, see http://nservicebus.com/

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top