spring-cloud / spring-cloud/spring-cloud-task
Improve documentation on Batch - Task integration, especially regarding datasource and transactionManagers
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 446
- Forks
- 310
- Avg merge
- 18h 18m
- Merged PRs (30d)
- 6
Description
Despite this and this, the outdated samples and the newer samples (later one seems to pass green because for some reason SimpleTaskAutoConfiguration is configuring the beans after JobConfiguration injections), I can't find a clear documentation on how we should combine Spring Batch and Spring Task at low level, which seems to be the scenario for the majority of user base, considering the issues section.
- Is desirable that both Batch (BatchAutoconfiguration) and Task (SimpleTasAutoconfiguration) reuse same datasource and transactionmanager?
- If no, which one should we use in JobConfiguration new API, that requires to pass transactionManager to create a tasklet or a chunklet?
- If yes, why is DefaultTaskConfigurer creating a TransactionManager from the @Primary datasource regardless any potential @Primary transactionManager
- Shouldn't the samples as defined right now fail on duplicate bean in JobConfiguration when trying to inject the @Primary transactionManager? In an scenario where defaults are provided, both DatasourceTransactionManager and SimpleTaskAutconfiguration expose a PlatformTransactionManager
The scenario gets even more tricky if the domain/logical part of the task also uses a database connection, so we need yet another datasource.
Thanks for all your amazing work so far, mates!!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the Spring Cloud Task Batch integration documentation with the linked Data Flow and spring-cloud-task sample paths, focusing on datasource and transaction manager configuration. Document the intended relationship between BatchAutoConfiguration and SimpleTaskAutoConfiguration, how JobConfiguration should choose a transaction manager, and how the samples should represent multiple database connections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- backend, databases, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100