-
Jun 30th, 2011, 04:49 AM
#1
Returned Object from ItemProcessor
In my spring batch job I return null in the processor when I want to skip an item, as reported in ItemProcessor javadoc. It works ok when I use an ItemProcessorAdapter: the item is not passed to ItemWriter.
If I use an AsyncItemProcessor to add multithread support, returning null from the same processor bean is not working. The null item is passed to ItemWriter, causing exception.
Is this correct? How can I skip an item when I use AsyncItemProcessor?
-
Jul 4th, 2011, 06:17 AM
#2
the AsyncItemProcessor always returns a Future. Consider using a wrapper that would poll the Future and check if the Future returns null (assuming the delegate item processor returns null immediately for a to-be-filtered item, it should work).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules