Tag: spring batch

在Spring Batch中使用多个DataSource

我试图在Spring Batch中配置几个数据源。 在启动时,Spring Batch抛出以下exception: To use the default BatchConfigurer the context must contain no more thanone DataSource, found 2 批量配置的代码段 @Configuration @EnableBatchProcessing public class BatchJobConfiguration { @Primary @Bean(name = “baseDatasource”) public DataSource dataSource() { // first datasource definition here } @Bean(name = “secondaryDataSource”) public DataSource dataSource2() { // second datasource definition here } … } […]