spring-projects / spring-projects/spring-batch
Add transactional extension points for synchronization and concurrency
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
Expected Behavior
Spring Batch provides extension points or publishes events at transaction boundaries so that we can synchronize/relate executions to external entities and also control job-level concurrency
Current Behavior
As far as I understand from the code, JobRepository methods are the transaction boundary and there is no simple way to attach listeners into those transactions.
Context
I am working on a batch work item queue where a single job must be executed orderly based on the queued files. I have a work item table in the db that I queue batch requests and then process the queue by a single threaded worker. I use work item id as the single identifying parameter. I'm facing two problems:
- I can't keep work item in sync with batch execution status. I think this may be possible through db triggers but not through application layer
- Job executions for work items must go through a single controlled api that synchronizes "claim next work item" and "start/restart execution" flows. My logic relies on claiming next available work item unless there are no active executions for that job. But that requires synchronization with the spring-batch operation.
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 reading the JobRepository methods identified as transaction boundaries and trace how job execution status and concurrency are handled. Define the required application-layer extension points or transaction-boundary events, including how external work items can stay synchronized and how orderly execution is enforced. Done means the proposed behavior and integration points are clear enough to support both use cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100