/// <summary>
        /// Configure the job server saga repositories to resolve from the container.
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="provider">The bus registration context provided during configuration</param>
        /// <returns></returns>
        public static IJobServiceConfigurator ConfigureSagaRepositories(this IJobServiceConfigurator configurator, IConfigurationServiceProvider provider)
        {
            configurator.Repository           = provider.GetRequiredService <ISagaRepository <JobTypeSaga> >();
            configurator.JobRepository        = provider.GetRequiredService <ISagaRepository <JobSaga> >();
            configurator.JobAttemptRepository = provider.GetRequiredService <ISagaRepository <JobAttemptSaga> >();

            return(configurator);
        }
        public static void UseEntityFrameworkCoreSagaRepository(this IJobServiceConfigurator configurator, Func<JobServiceSagaDbContext> contextFactory,
            ILockStatementProvider lockStatementProvider = default)
        {
            configurator.Repository = EntityFrameworkSagaRepository<JobTypeSaga>.CreatePessimistic(contextFactory, lockStatementProvider);

            configurator.JobRepository = EntityFrameworkSagaRepository<JobSaga>.CreatePessimistic(contextFactory, lockStatementProvider);

            configurator.JobAttemptRepository = EntityFrameworkSagaRepository<JobAttemptSaga>.CreatePessimistic(contextFactory, lockStatementProvider);
        }
Esempio n. 3
0
 public static void UseAzureTableSagaRepository(this IJobServiceConfigurator configurator,
                                                Func <CloudTable> contextFactory)
 {
     UseAzureTableSagaRepository(configurator,
                                 contextFactory,
                                 new ConstPartitionSagaKeyFormatter <JobTypeSaga>(typeof(JobTypeSaga).Name),
                                 new ConstPartitionSagaKeyFormatter <JobSaga>(typeof(JobSaga).Name),
                                 new ConstPartitionSagaKeyFormatter <JobAttemptSaga>(typeof(JobAttemptSaga).Name));
 }
Esempio n. 4
0
        public static void UseAzureTableSagaRepository(this IJobServiceConfigurator configurator,
                                                       Func <CloudTable> contextFactory)
        {
            configurator.Repository = AzureTableSagaRepository <JobTypeSaga> .Create(contextFactory);

            configurator.JobRepository = AzureTableSagaRepository <JobSaga> .Create(contextFactory);

            configurator.JobAttemptRepository = AzureTableSagaRepository <JobAttemptSaga> .Create(contextFactory);
        }
Esempio n. 5
0
        public static void UseAzureTableSagaRepository(this IJobServiceConfigurator configurator,
                                                       Func <CloudTable> contextFactory,
                                                       ISagaKeyFormatter <JobTypeSaga> jobTypeKeyFormatter,
                                                       ISagaKeyFormatter <JobSaga> jobKeyFormatter,
                                                       ISagaKeyFormatter <JobAttemptSaga> jobAttemptKeyFormatter)
        {
            configurator.Repository = AzureTableSagaRepository <JobTypeSaga> .Create(contextFactory, jobTypeKeyFormatter);

            configurator.JobRepository = AzureTableSagaRepository <JobSaga> .Create(contextFactory, jobKeyFormatter);

            configurator.JobAttemptRepository = AzureTableSagaRepository <JobAttemptSaga> .Create(contextFactory, jobAttemptKeyFormatter);
        }