Results 1 to 3 of 3

Thread: itemProcessor in Composite Item Writer model

  1. #1

    Default itemProcessor in Composite Item Writer model

    Hello,

    I spring batch 1.1.x version, we could define a CompositeItemWriter with several item writers executed in sequence. These item writers can be an implementation of an ItemTransformerItemWriter allowing to have several processing/writing for the same chunk.

    Did we lose this capability in 2.0.0? I cannot seem to find a way to couple an ItemProcessor with an ItemWriter.

    The work-around that I found is injecting an ItemProcessor in my custom ItemWriter (following the old ItemTransformerItemWriter) model.

    Do you agree? or is there a better way?

    Thanks,
    Marwan

  2. #2
    Join Date
    Feb 2008
    Posts
    488

    Default

    I'm not sure there's much reason for injecting an ItemProcessor into a custom ItemWriter. It probably makes more sense to just do the "processing" in the ItemWriter before writing the item out.

  3. #3
    Join Date
    Apr 2009
    Posts
    9

    Default

    Something like ItemTransformerItemWriter can be helpful for chunk transforming. The ItemProcessor in Spring Batch 2.0 doesn't support chunk processing. Only one item per call.

Posting Permissions

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