0
votes

how the lifecycle of step scoped bean is exactly defined, especially in case when I have partitioned scope?

For example:

  • gridSize = 4
  • SimplePartitioner used as a Partitioner (will create 4 partition definitions)
  • RepositoryItemReader as step scoped bean

The question is: how many parallel steps will be created assuming a simple flow (read, process, write, finish)? 4 parallel steps? Do every step has its own RepositoryItemReader, so in result there will be 4 RepositoryItemReaders?

1

1 Answers

1
votes

A bean that is step scoped will get one instance per StepExecution. So using your example you will end up with four RepositoryItemReader instances, one per partition. This allows the state of each partition to be independent to support things like restartability.