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);
        }
        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
        }
Example #3
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);
        }
        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
        }
Example #6
0
        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(SubscriptionStorage))
            {
                NHibernateSettingRetriever.ConnectionStrings = () =>
                {
                    var c = new ConnectionStringSettingsCollection();

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


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

            throw new InvalidOperationException("Unknown persister:" + persister);
        }