Announcement Announcement Module
Collapse
No announcement yet.
itemProcessor in Composite Item Writer model Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment

      Working...
      X