Results 1 to 5 of 5

Thread: ItemProcessor

  1. #1
    Join Date
    Nov 2006
    Posts
    8

    Default 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. #2
    Join Date
    Nov 2006
    Posts
    8

    Default

    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.

  3. #3

    Default

    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)

  4. #4
    Join Date
    Nov 2006
    Posts
    8

    Default

    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.

  5. #5
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    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)

Posting Permissions

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