CustomRavenConfig(Configure configure)
        {
            #region OldRavenDBPersistenceInitialization

            configure.RavenPersistence();
            configure.RavenSagaPersister();
            configure.RavenSubscriptionStorage();
            configure.UseRavenTimeoutPersister();
            configure.UseRavenGatewayDeduplication();
            configure.UseRavenGatewayPersister();

            #endregion

            #region Version2_5RavenDBPersistenceInitialization

            // Need to call this method
            configure.RavenDBStorage();
            // Call this method to use Raven saga storage
            configure.UseRavenDBSagaStorage();
            // Call this method to use Raven subscription storage
            configure.UseRavenDBSubscriptionStorage();
            // Call this method to use Raven timeout storage
            configure.UseRavenDBTimeoutStorage();
            // Call this method to use Raven deduplication storage for the Gateway
            configure.UseRavenDBGatewayDeduplicationStorage();
            // Call this method to use the  Raven Gateway storage method
            configure.UseRavenDBGatewayStorage();

            #endregion
        }
        public static Configure DefineSagaPersister(this Configure config, string persister)
        {
            if (string.IsNullOrEmpty(persister))
            {
                persister = SagaPersisters.Default.Settings["SagaPersister"];
            }



            if (persister.Contains(typeof(InMemorySagaPersister).FullName))
            {
                return(config.InMemorySagaPersister());
            }


            if (persister.Contains(typeof(RavenSagaPersister).FullName))
            {
                config.RavenPersistence(() => "url=http://localhost:8080");
                return(config.RavenSagaPersister());
            }


            var type = Type.GetType(persister);

            var typeName = "Configure" + type.Name;

            var configurer = Activator.CreateInstance(Type.GetType(typeName));

            dynamic dc = configurer;

            dc.Configure(config);

            return(config);
        }
Example #3
0
        protected override void Initialize(Configure config)
        {
            connectionStringFunc = () => "Url = http://localhost:8080; DefaultDatabase=MyDB";
            database             = "CustomDatabase";

            config.RavenPersistence(connectionStringFunc, database);
        }
Example #4
0
        public void Persistence()
        {
            Configure configure = Configure.With();

            #region 4to5ConfigurePersistence

            // Configure to use InMemory
            configure.InMemorySagaPersister();
            configure.UseInMemoryTimeoutPersister();
            configure.InMemorySubscriptionStorage();
            configure.RunGatewayWithInMemoryPersistence();
            configure.UseInMemoryGatewayDeduplication();

            // Configure to use NHibernate
            configure.UseNHibernateSagaPersister();
            configure.UseNHibernateTimeoutPersister();
            configure.UseNHibernateSubscriptionPersister();
            configure.UseNHibernateGatewayPersister();
            configure.UseNHibernateGatewayDeduplication();

            // Configure to use RavenDB for everything
            configure.RavenPersistence();

            // Configure to use RavenDB
            configure.RavenSagaPersister();
            configure.UseRavenTimeoutPersister();
            configure.RavenSubscriptionStorage();
            configure.RunGatewayWithRavenPersistence();
            configure.UseNHibernateGatewayDeduplication();

            #endregion
        }
        public static Configure DefineSubscriptionStorage(this Configure config, string persister)
        {
            if (string.IsNullOrEmpty(persister))
            {
                return(config.InMemorySubscriptionStorage());
            }

            var type = Type.GetType(persister);

            if (type == typeof(InMemorySubscriptionStorage))
            {
                return(config.InMemorySubscriptionStorage());
            }

            if (type == typeof(RavenSubscriptionStorage))
            {
                config.RavenPersistence(() => "url=http://localhost:8080");
                return(config.RavenSubscriptionStorage());
            }


            if (type == typeof(MsmqSubscriptionStorage))
            {
                return(config.MsmqSubscriptionStorage());
            }

            throw new InvalidOperationException("Unknown persister:" + persister);
        }
Example #6
0
        public static Configure DefineSagaPersister(this Configure config, string persister)
        {
            if (string.IsNullOrEmpty(persister))
            {
                return(config.InMemorySagaPersister());
            }

            var type = Type.GetType(persister);

            if (type == typeof(InMemorySagaPersister))
            {
                return(config.InMemorySagaPersister());
            }

            if (type == typeof(RavenSagaPersister))
            {
                config.RavenPersistence(() => "url=http://localhost:8080");
                return(config.RavenSagaPersister());
            }

            if (type == typeof(SagaPersister))
            {
                NHibernateSettingRetriever.ConnectionStrings = () =>
                {
                    var c = new ConnectionStringSettingsCollection();

                    c.Add(new ConnectionStringSettings("NServiceBus/Persistence", NHibernateConnectionString));
                    return(c);
                };
                return(config.UseNHibernateSagaPersister());
            }

            throw new InvalidOperationException("Unknown persister:" + persister);
        }
        CustomRavenConfig(Configure configure)
        {
            #region OldRavenDBPersistenceInitialization

            configure.RavenPersistence();
            configure.RavenSagaPersister();
            configure.RavenSubscriptionStorage();
            configure.UseRavenTimeoutPersister();
            configure.UseRavenGatewayDeduplication();
            configure.UseRavenGatewayPersister();

            #endregion

            #region Version2_5RavenDBPersistenceInitialization

            // Need to call this method
            configure.RavenDBStorage();
            // Call this method to use Raven saga storage
            configure.UseRavenDBSagaStorage();
            // Call this method to use Raven subscription storage
            configure.UseRavenDBSubscriptionStorage();
            // Call this method to use Raven timeout storage
            configure.UseRavenDBTimeoutStorage();
            // Call this method to use Raven deduplication storage for the Gateway
            configure.UseRavenDBGatewayDeduplicationStorage();
            // Call this method to use the  Raven Gateway storage method
            configure.UseRavenDBGatewayStorage();

            #endregion
        }
        protected override void Initialize(Configure config)
        {
            connectionStringFunc = () => "Url = http://localhost:8080; DefaultDatabase=MyDB";
            database = "CustomDatabase";

            config.RavenPersistence(connectionStringFunc, database);
        }
        public static Configure DefineSubscriptionStorage(this Configure config, string persister)
        {
            if (string.IsNullOrEmpty(persister))
            {
                persister = SubscriptionPersisters.Default.Settings["SubscriptionStorage"];
            }

            if (persister.Contains(typeof(InMemorySubscriptionStorage).FullName))
            {
                return(config.InMemorySubscriptionStorage());
            }

            if (persister.Contains(typeof(RavenSubscriptionStorage).FullName))
            {
                config.RavenPersistence(() => "url=http://localhost:8080");
                return(config.RavenSubscriptionStorage());
            }

            if (persister.Contains(typeof(MsmqSubscriptionStorage).FullName))
            {
                return(config.MsmqSubscriptionStorage());
            }

            CallConfigureForPersister(config, persister);

            return(config);
        }
Example #10
0
        void CustomRavenConfig(Configure configure)
        {
            #region 4to5CustomRavenConfig

            configure.RavenPersistence("http://localhost:8080", "MyDatabase");

            #endregion
        }
Example #11
0
        public void CustomRavenConfig()
        {
            #region 4to5CustomRavenConfig

            Configure configure = Configure.With();
            configure.RavenPersistence("http://localhost:8080", "MyDatabase");

            #endregion
        }
Example #12
0
        public static Configure RavenSubscriptionStorage(this Configure config)
        {
            if (!config.Configurer.HasComponent <IDocumentStore>())
            {
                config.RavenPersistence();
            }

            var store = config.Builder.Build <IDocumentStore>();

            var endpoint = Assembly.GetCallingAssembly()
                           .GetName().Name;

            return(RavenSubscriptionStorage(config, store, endpoint));
        }
        public static Configure DefineTimeoutPersister(this Configure config, string persister)
        {
            if (string.IsNullOrEmpty(persister))
            {
                persister = TimeoutPersisters.Default.Settings["TimeoutPersister"];
            }

            if (persister.Contains(typeof(InMemoryTimeoutPersistence).FullName))
            {
                return(config.UseInMemoryTimeoutPersister());
            }

            if (persister.Contains(typeof(RavenTimeoutPersistence).FullName))
            {
                config.RavenPersistence(() => "url=http://localhost:8080");
                return(config.UseRavenTimeoutPersister());
            }

            CallConfigureForPersister(config, persister);

            return(config);
        }
 protected override void Initialize(Configure config)
 {
     config.RavenPersistence("RavenWithDefaultDBSetUsingDataBase");
 }
 protected override void Initialize(Configure config)
 {
     config.RavenPersistence(() => "Url = http://localhost:8080");
 }
Example #16
0
 protected virtual void Initialize(Configure config)
 {
     config.RavenPersistence();
 }
 protected virtual void Initialize(Configure config)
 {
     config.RavenPersistence();
 }
 protected override void Initialize(Configure config)
 {
     config.RavenPersistence("Raven", "CustomDatabase");
 }
 protected override void Initialize(Configure config)
 {
     config.RavenPersistence("RavenWithDefaultDBSet");
 }
 protected override void Initialize(Configure config)
 {
     config.RavenPersistence(() => "Url = http://localhost:8080");
 }
 protected override void Initialize(Configure config)
 {
     config.RavenPersistence("Raven", "CustomDatabase");
 }
 protected override void  Initialize(Configure config)
 {
     config.RavenPersistence("RavenWithRmSet");
 }
 protected override void Initialize(Configure config)
 {
     config.RavenPersistence("Raven");
 }