spring-projects / spring-projects/spring-batch

Allow defining the Job level on @JobScope when we are using parent and child jobs (JobStepBuilder)

Open
#4,597 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: feature
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

When using an architecture of jobs and subjobs, we miss a way to specify the level of @JobScope on certain @Beans.
For instance, if we have a parent job that executes jobA, jobB and jobC, a @Bean marked with @JobScope will be instantiated 3 times (scope set to bottom-level of job), but I want it to be shared among the three subjobs.

If I define the @Bean without batch scopes, therefore a singleton, when joblaunching parent job multiple times, my @Bean is shared among all parent job executions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the @JobScope behavior and the JobStepBuilder entry point mentioned in the issue, focusing on how parent and child jobs determine scope. Done means a bean can be shared across the child jobs of one parent execution while remaining isolated between separate parent job executions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.