Repository navigation
Do you use job scoped beans? #4869
Closed
fmbenhassine
started this conversation in
Polls
Replies: 3 comments 2 replies
|
In most cases, it’s used to configure beans associated with JobParameters. @Bean
@JobScope
public HelloDate2Tasklet helloDate2Tasklet(
@Value("#{jobParameters['helloDate']}") LocalDate date) {
return new HelloDate2Tasklet(date);
} |
2 replies
|
In a multistep batch we use job scoped beans if they are requiring some job parameters and the bean is used multiple steps. I think decommissioning the job scope would be very weird. However, that's true in our case, that we try to avoid the multistep batches with simpler design if possible. As a consequence, not very often we actually need the job scoped beans. I would say in around 95% percent we are fine with the step scope only. But what we would do in the remining 5%? I hope this helps. |
0 replies
|
Based on #5311 (reply in thread), I believe we found a valid use case for job-scope starting from v6. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Do you use job scoped beans (ie
@JobScope)? If yes, please elaborate on your use case by adding a comment with an example.12 votes ·
All reactions