Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-configuration for Spring Batch's MongoJobRepository #43236

Open
philwebb opened this issue Nov 21, 2024 · 4 comments
Open

Add auto-configuration for Spring Batch's MongoJobRepository #43236

philwebb opened this issue Nov 21, 2024 · 4 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

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

@philwebb philwebb added the type: bug A general bug label Nov 21, 2024
@philwebb philwebb added this to the 3.4.0 milestone Nov 21, 2024
@philwebb
Copy link
Member Author

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

@philwebb
Copy link
Member Author

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);
	}

@philwebb philwebb reopened this Nov 21, 2024
@philwebb
Copy link
Member Author

@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

wilkinsona added a commit that referenced this issue Nov 21, 2024
@wilkinsona wilkinsona changed the title Spring Batch applications fail to start when a custom JobRepository bean is defined Add auto-configuration for Spring Batch's MongoJobRepository Nov 21, 2024
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed type: bug A general bug labels Nov 21, 2024
@wilkinsona wilkinsona modified the milestones: 3.4.0, 3.5.x Nov 21, 2024
@wilkinsona
Copy link
Member

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.

@wilkinsona wilkinsona modified the milestones: 3.5.x, 4.0.x Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants