Do you use job scoped beans? #4869
Replies: 2 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);
} |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
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.11 votes ·
Beta Was this translation helpful? Give feedback.
All reactions