Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }