Is it true that a step has to be item oriented?
Is it true that a step has to be item oriented?
Spring Batch is item oriented because it is a good practise in batch designing and easier to process data.
Of course, you also can return a List of items from a ItemReader, but it is tedious to iterate lists in the ItemProcessor and the source code is not clear.
Hope to help you.
Thanks for the reply.
I understand the item oriented processing nature, but often there are requirements to pre-process all batch items, for example validating the total count, before starting each item processing. Just want to configure this pre-processing as part of the batch job within spring batch, otherwise I would have to create a totally different job to do that step, then trigger the spring batch job afterwards.
I think you can define in the same job two jobs: the first step do all the validations and the, if and only if this step ends ok (COMPLETED), go to the next step to process irem by item.
Regards,
I don't get what you mean. Are you saying you can configure a spring batch job to do the validation that I wanted? Doesn't it imply I can create non-item oriented processing?
Not all steps are required to be item based. The Tasklet interface is intended for you to implement non item based processing. http://static.springsource.org/sprin...ml#taskletStep
Michael Minella
Spring Batch Lead
Author - Pro Spring Batch
http://www.michaelminella.com
Twitter: @MichaelMinella