Announcement Announcement Module
Collapse
No announcement yet.
ItemProcessor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ItemProcessor

    Hi

    Ive been using m3 for quite a while now and have a few jobs that use the ItemReader - ItemProcessor - ItemWriter style for reading, processing and writing data.

    After upgrade to 1.0.0.FINAL I see that ItemProcessor is removed with no obvious replacement.

    What is the correct way to get this behaviour in the final versoin?

    Claes

  • #2
    Forgot to mention that Im aware of the tasklet step.
    But what I miss there is something like 'execute( Object o)'. I cant seem to find a reference to the object read by the ItemReader in a tasklet.

    Comment


    • #3
      Hi,
      Please read the migration steps in the following link
      http://static.springframework.org/sp...1.0-m3-m4.html

      This is what being said the link.

      OutputSource and ItemProcessor interfaces have been merged into ItemWriter (ItemTransformerItemWriter and CompositeItemTransformer provide support for item transformations before writing to output)

      Comment


      • #4
        Thanks, this is what I was looking for!

        I dont find transformer a fitting name/tool for performing logic based on the object read from the InputSource but that is another matter.

        Comment


        • #5
          You can really call it anything you want. We really needed to work directly with a reader and a writer, and the Step implementations don't care too much about how they are implemented. If you wanted to create something that had an ItemProcessor, you certainly could. From the framework's perspective we needed to draw a line in the sand between read and write. If you look at how skip is handled, read failures won't cause a rollback of the transaction, whereas write failures will, etc. At one point we talked about putting a 'processor' in the middle between them, but then you run into problems if a processor isn't needed, and how should we handled exceptions from there? Should it rollback? It was much cleaner to have a simple read or write and let users decide whether they wanted to insert their logic after an item is read, or before an item is written. (Although ideally if there's any processing going on it should be on the write side)

          Comment

          Working...
          X