Вопрос

Is there anyway to use NServicebus 4 without installing RavenDB? We are using 2.5 and I would like to upgrade to 4 but this will be a tough sell if we have to install RavenDB on our production server. Is there any work around?

Это было полезно?

Решение

Yes. You can use NServiceBus without RavenDB. While, the default subscription storage (for pub/sub), default saga persister and default timeout persister is RavenDB, using custom initialization like shown below, you can switch them to NHibernate persistence instead, in which case you won't need RavenDB.

class CustomInit : INeedInitialization
{
    public void Init()
    {
        Configure.Instance.UseNHibernateSubscriptionPersister();
        Configure.Instance.UseNHibernateSagaPersister();
        Configure.Instance.UseNHibernateTimeoutPersister();
    }
}

And also the app.config for using NHibernate is further simplified in 4.x

         <connectionStrings>
<add name="NServiceBus/Persistence" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True"/>

and specify the other needed NHibernate settings like below in appSettings:

    <appSettings>
<!-- dialect is defaulted to MsSql2008Dialect, if needed change accordingly -->
<add key="NServiceBus/Persistence/NHibernate/dialect" value="NHibernate.Dialect.MsSql2008Dialect" />
<!-- other optional settings examples -->
<add key="NServiceBus/Persistence/NHibernate/connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="NServiceBus/Persistence/NHibernate/connection.driver_class" value="NHibernate.Driver.Sql2008ClientDriver" />

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top