Results 1 to 7 of 7

Thread: How to configure a step for NON item oriented processing?

  1. #1
    Join Date
    Mar 2010
    Posts
    5

    Default How to configure a step for NON item oriented processing?

    Is it true that a step has to be item oriented?

  2. #2
    Join Date
    Oct 2012
    Location
    Madrid
    Posts
    20

    Default

    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.

  3. #3
    Join Date
    Mar 2010
    Posts
    5

    Default

    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.

  4. #4
    Join Date
    Oct 2012
    Location
    Madrid
    Posts
    20

    Default

    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,

  5. #5
    Join Date
    Mar 2010
    Posts
    5

    Default

    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?

  6. #6
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    366

    Default

    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

  7. #7
    Join Date
    Oct 2012
    Location
    Madrid
    Posts
    20

    Talking

    Quote Originally Posted by mminella View Post
    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
    Yes, that it was I would want to explain

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •