static TimeoutService CreateSQLTimeoutService(TimeoutConfigurationSection configuration) { try { log.Info("Using the SQL timeout storage - the table name '{0}' will be used", configuration.TableName); return new TimeoutService(new SqlServerTimeoutStorage(configuration.ConnectionString, configuration.TableName) .EnsureTableIsCreated(), configuration.InputQueue, configuration.ErrorQueue); } catch (Exception e) { log.Error(e, "An error occurred while attempting to configure the timeout manager"); throw; } }
static TimeoutService CreateMongoDbTimeoutService(TimeoutConfigurationSection configuration) { try { log.Info("Using the MongoDB timeout storage - the collection name '{0}' will be used", configuration.TableName); return new TimeoutService(new MongoDbTimeoutStorage(configuration.ConnectionString, configuration.TableName), configuration.InputQueue, configuration.ErrorQueue); } catch (Exception e) { log.Error(e, "An error occurred while attempting to configure the timeout manager"); throw; } }