Class BatchClusterAutoConfiguration

java.lang.Object
io.github.jchejarla.springbatch.clustering.autoconfigure.BatchClusterAutoConfiguration

@AutoConfiguration @ConditionalOnProperty(name="spring.batch.cluster.enabled", havingValue="true") @EnableConfigurationProperties(BatchClusterProperties.class) @AutoConfigureAfter({org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration.class,org.springframework.boot.batch.autoconfigure.BatchAutoConfiguration.class}) @EnableScheduling public class BatchClusterAutoConfiguration extends Object
  • Constructor Details

    • BatchClusterAutoConfiguration

      public BatchClusterAutoConfiguration()
  • Method Details

    • clusterJobRepositoryValidator

      @Bean @ConditionalOnMissingBean public ClusterJobRepositoryValidator clusterJobRepositoryValidator(org.springframework.batch.core.repository.JobRepository jobRepository)
      Fails fast if clustering is enabled on the Spring Batch 6 default (in-memory) JobRepository, which cannot coordinate a cluster. See ClusterJobRepositoryValidator.
    • databaseBackedClusterService

      @Bean @ConditionalOnMissingBean public DatabaseBackedClusterService databaseBackedClusterService(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, BatchClusterProperties batchClusterProperties, DBSpecificQueryProvider dbSpecificQueryProvider)
    • clusterAwarePartitionHandler

      @Bean @ConditionalOnMissingBean public ClusterAwarePartitionHandler clusterAwarePartitionHandler(DatabaseBackedClusterService databaseBackedClusterService, BatchClusterProperties batchClusterProperties)
    • clusterNodeManager

      @Bean @ConditionalOnMissingBean public ClusterNodeManager clusterNodeManager(DatabaseBackedClusterService databaseBackedClusterService, BatchClusterProperties batchClusterProperties, @Qualifier("clusterHealthMonitoringScheduler") org.springframework.scheduling.TaskScheduler clusterMonitoringScheduler, ClusterNodeInfo clusterNodeInfo, ClusterNodeStatusChangeConditionNotifier clusterNodeStatusChangeConditionNotifier)
    • clusterJobRecoveryManager

      @Bean @ConditionalOnMissingBean public ClusterJobRecoveryManager clusterJobRecoveryManager(DatabaseBackedClusterService databaseBackedClusterService, BatchClusterProperties batchClusterProperties, org.springframework.batch.core.repository.explore.JobExplorer jobExplorer, org.springframework.batch.core.repository.JobRepository jobRepository, @Qualifier("clusterHealthMonitoringScheduler") org.springframework.scheduling.TaskScheduler clusterMonitoringScheduler)
    • partitionWorkerTasksRunner

      @Bean @ConditionalOnMissingBean public PartitionedWorkerNodeTasksRunner partitionWorkerTasksRunner(org.springframework.context.ApplicationContext applicationContext, org.springframework.batch.core.repository.explore.JobExplorer jobExplorer, org.springframework.batch.core.repository.JobRepository jobRepository, @Qualifier("clusteredStepsTasksExecutor") org.springframework.core.task.TaskExecutor taskExecutor, BatchClusterProperties batchClusterProperties, DatabaseBackedClusterService databaseBackedClusterService, @Qualifier("partitionPollingScheduler") org.springframework.scheduling.TaskScheduler partitionPollingScheduler, @Qualifier("completedTasksCleanupScheduler") org.springframework.scheduling.TaskScheduler completedTasksCleanupScheduler, @Qualifier("updateBatchPartitionsScheduler") org.springframework.scheduling.TaskScheduler updateBatchPartitionsScheduler, ClusterNodeInfo clusterNodeInfo)
    • dbSpecificQueryProvider

      @Bean @ConditionalOnMissingBean public DBSpecificQueryProvider dbSpecificQueryProvider(DataSource dataSource) throws SQLException
      Throws:
      SQLException
    • batchClusterDataSourceScriptDatabaseInitializer

      @Bean @ConditionalOnMissingBean @DependsOnDatabaseInitialization public BatchClusterDataSourceScriptDatabaseInitializer batchClusterDataSourceScriptDatabaseInitializer(DataSource dataSource, BatchClusterProperties batchClusterProperties) throws SQLException
      Optionally creates the cluster tables on startup, controlled by spring.batch.cluster.initialize-schema (see BatchClusterProperties).

      Annotated DependsOnDatabaseInitialization so it runs after any database initialization (Flyway, Liquibase, or spring.sql.init) that creates the Spring Batch schema, letting the foreign keys to BATCH_JOB_EXECUTION/BATCH_STEP_EXECUTION resolve. Note that Spring Boot 4 no longer auto-creates the Spring Batch schema, so the application must initialize it (a migration tool is recommended for production).

      Throws:
      SQLException
    • clusterMonitoringScheduler

      @Bean(name="clusterHealthMonitoringScheduler") public org.springframework.scheduling.TaskScheduler clusterMonitoringScheduler()
    • partitionPollingScheduler

      @Bean(name="partitionPollingScheduler") public org.springframework.scheduling.TaskScheduler partitionPollingScheduler()
    • completedTasksCleanupScheduler

      @Bean(name="completedTasksCleanupScheduler") public org.springframework.scheduling.TaskScheduler completedTasksCleanupScheduler()
    • updateBatchPartitionsScheduler

      @Bean(name="updateBatchPartitionsScheduler") public org.springframework.scheduling.TaskScheduler updateBatchPartitionsScheduler()
    • clusteredStepsTasksExecutor

      @Bean("clusteredStepsTasksExecutor") public org.springframework.core.task.TaskExecutor clusteredStepsTasksExecutor(BatchClusterProperties batchClusterProperties)
    • clusterNodeInfo

      @Bean public ClusterNodeInfo clusterNodeInfo(BatchClusterProperties batchClusterProperties)
    • batchClusterNodeHealthIndicator

      @Bean public BatchClusterNodeHealthIndicator batchClusterNodeHealthIndicator(ClusterNodeInfo clusterNodeInfo)
    • batchClusterHealthIndicator

      @Bean public BatchClusterHealthIndicator batchClusterHealthIndicator(ClusterNodeManager clusterNodeManager)
    • batchClusteringInfoContributor

      @Bean public BatchClusteringInfoContributor batchClusteringInfoContributor(BatchClusterProperties batchClusterProperties)
    • batchClusterNodesEndpoint

      @Bean public BatchClusterNodesEndpoint batchClusterNodesEndpoint(ClusterNodeManager clusterNodeManager)
    • batchClusterQueryService

      @Bean @ConditionalOnMissingBean public BatchClusterQueryService batchClusterQueryService(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, DBSpecificQueryProvider dbSpecificQueryProvider)
    • batchClusterJobsEndpoint

      @Bean public BatchClusterJobsEndpoint batchClusterJobsEndpoint(BatchClusterQueryService batchClusterQueryService)