sbmako / NServiceBus.MongoDB

MongoDB persistence for NServiceBus
MIT License
13 stars 9 forks source link

Configuration per StorageType in .config-file #12

Open danielHalan opened 9 years ago

danielHalan commented 9 years ago

About configuration of the Connection String, would be nice if it followed similar naming convention as NHibernate example, so

  cfg.UsePersistence<MongoDBPersistence, StorageType.Sagas>()
    .SetDatabaseName("x_sagas");

Would look for,

  <add name="NServiceBus/Persistence/MongoDB/Saga"
      connectionString="mongodb://..."/>

This would be useful when mixing Persistence types

Full documentation and example in NHibernate http://docs.particular.net/nservicebus/nhibernate/configuration

sbmako commented 9 years ago

Thanks. We will make it more consistent. If i understand it correctly, there would be a hierarchy for example in this configuration:

  <add name="NServiceBus/Persistence/MongoDB"
      connectionString="mongodb://..."/>
  <add name="NServiceBus/Persistence/MongoDB/Saga"
      connectionString="mongodb://..."/>

Sagas would use the second connection string but other things such as timeouts would use the first connection string.

Correct?

danielHalan commented 9 years ago

Correct.

Also if "NServiceBus/Persistence/MongoDB" is not specified, checking "NServiceBus/Persistence". http://docs.particular.net/nservicebus/ravendb/connecting#nservicebus-5-configuring-how-to-connect-to-the-ravendb-server-shared-store-for-all-persisters-defined-via-connection-string

sbmako commented 9 years ago

Initially updated the code to use "NServiceBus/Persistence/MongoDB". Will continue to look at providing saga, timeout and subscription specific connection strings.