/// <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); }); }
/// <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; }); }