Sample at https://github.com/joshlong-attic/2024-11-20-batch-job-repository

Comment From: philwebb

This bug exists in earlier versions, but given it's mostly going to be triggered by the new MongoJobRepositoryFactoryBean I think we should keep the target to 3.4

Comment From: philwebb

The sample now appears to start if:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-batch</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-jdbc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

and

    @Bean
    MongoTransactionManager mongoTransactionManager(MongoDatabaseFactory dbf) {
        return new MongoTransactionManager(dbf);
    }

Comment From: philwebb

@mbhave pointed out that BatchAutoConfiguration depends on DataSource so it may back off entirely with the pring-boot-starter-jdbc exclusion. We probably need a more complete fix for Mongo support.

That might need to wait until 3.5, in which case we could revert my "fix" in 3.4

Comment From: wilkinsona

Chatting with @fmbenhassine, this may need to wait for Spring Boot 4.0/Spring Batch 6.0 to allow some breaking changes to be made, such as DefaultBatchConfiguration losing its DataSource assumptions.

Comment From: snicoll

The sample now appears to start if:

That's essentially disabling the auto-configuration. The app starts but the Job doesn't. I was curious to see how that would work since some collections need to be created for the sample to work...