protected override void DoSetUp()
        {
            DropTable(SubscriptionsTableName);

            storage = new PostgreSqlSubscriptionStorage(GetOrCreateConnection, SubscriptionsTableName);
            storage.EnsureTableIsCreated();
        }
示例#2
0
        /// <summary>
        /// Configures Rebus to store subscriptions in PostgreSQL.
        /// </summary>
        public static PostgreSqlSubscriptionStorageFluentConfigurer StoreInPostgreSql(this RebusSubscriptionsConfigurer configurer, string connectionString, string subscriptionsTableName)
        {
            var storage = new PostgreSqlSubscriptionStorage(connectionString, subscriptionsTableName);

            configurer.Use(storage);

            return new PostgreSqlSubscriptionStorageFluentConfigurer(storage);
        }
示例#3
0
        /// <summary>
        /// Configures Rebus to store subscriptions in PostgreSQL.
        /// </summary>
        public static PostgreSqlSubscriptionStorageFluentConfigurer StoreInPostgreSql(this RebusSubscriptionsConfigurer configurer, string connectionString, string subscriptionsTableName)
        {
            var storage = new PostgreSqlSubscriptionStorage(connectionString, subscriptionsTableName);

            configurer.Use(storage);

            return(new PostgreSqlSubscriptionStorageFluentConfigurer(storage));
        }
        /// <summary>
        /// Configures Rebus to use PostgreSQL to store subscriptions. Use <see cref="isCentralized"/> = true to indicate whether it's OK to short-circuit
        /// subscribing and unsubscribing by manipulating the subscription directly from the subscriber or just let it default to false to preserve the
        /// default behavior.
        /// </summary>
        public static void StoreInPostgres(this StandardConfigurer <ISubscriptionStorage> configurer,
                                           string connectionString, string tableName, bool isCentralized = false, bool automaticallyCreateTables = true)
        {
            configurer.Register(c =>
            {
                var rebusLoggerFactory  = c.Get <IRebusLoggerFactory>();
                var connectionHelper    = new PostgresConnectionHelper(connectionString);
                var subscriptionStorage = new PostgreSqlSubscriptionStorage(
                    connectionHelper, tableName, isCentralized, rebusLoggerFactory);

                if (automaticallyCreateTables)
                {
                    subscriptionStorage.EnsureTableIsCreated();
                }

                return(subscriptionStorage);
            });
        }
示例#5
0
 public PostgreSqlSubscriptionStorageFluentConfigurer(PostgreSqlSubscriptionStorage postgreSqlSubscriptionStorage)
 {
     this.postgreSqlSubscriptionStorage = postgreSqlSubscriptionStorage;
 }
        protected override void DoSetUp()
        {
            DropTable(SubscriptionsTableName);

            storage = new PostgreSqlSubscriptionStorage(ConnectionString, SubscriptionsTableName);
        }
示例#7
0
 public PostgreSqlSubscriptionStorageFluentConfigurer(PostgreSqlSubscriptionStorage postgreSqlSubscriptionStorage)
 {
     this.postgreSqlSubscriptionStorage = postgreSqlSubscriptionStorage;
 }