Phil Sandler
Phil Sandler

Reputation: 28016

NEventStore with RavenDB in Embedded Mode

I am trying to get NEventStore (v4) working with RavenDB in embedded mode.

My connection string looks like this:

<add name="EventStore" connectionString="DataDir = ~\Data" />

In Application_Start, I set up the Raven Store like this:

var documentStore = new EmbeddableDocumentStore
{
    ConnectionStringName = "EventStore"
};
documentStore.Initialize();

This runs before any event store code gets initialized. I am able to use Raven to save documents at this point. So Raven is working.

For NEventStore, init looks like this:

_store = Wireup.Init()
    .LogToOutputWindow()
    .UsingRavenPersistence("EventStore") 
    .InitializeStorageEngine()
    .UsingJsonSerialization()
    .Compress()
    .UsingSynchronousDispatchScheduler()
    .DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
    .Build();

When this runs, I get this error:

Connection string name: 'EventStore' could not be parsed, unknown option: 'datadir'

In looking at the (RavenDB) source code, it appears that the connection string parser doesn't know that it is reading an embedded connection string. But I don't see any way of indicating that NEventStore is to use Raven in embedded mode.

Upvotes: 1

Views: 323

Answers (1)

dusky
dusky

Reputation: 1313

The option 'DataDir' only works with an EmbeddableDocumentStore. NEventstore creates a DocumentStore. As far I know you can't change this behavior.

What you could do is to start the Embedded RavenDB with HTTP enabled and connect to localhost.

Upvotes: 0

Related Questions