Mar 11th, 2008, 11:26 PM
StatefulRetryStepFactoryBean and ValidatingItemReader
sorry if this q has already been answered.
i have a StatefulRetryStepFactoryBean configured with a SimpleRetryPolicy if 3 attempts and a ValidatingItemReader.
when the ValidatingItemReader throws a ValidationException the invalid record is re-read ad-infinitum
am i missing something?
attached is the bean definition
i am also able to provide more info if required
thanks in advance
Last edited by wawrick.mayson; Mar 11th, 2008 at 11:31 PM.
Reason: added attachments
Mar 12th, 2008, 02:55 AM
I can't see anything wrong with your config, but it doesn't match the latest version (you don't have to set the retry policy directly now). Can you try with a snapshot because that factory bean was revamped just after the m5 release, and one of the things we did was align the limits with the exception handlers? There was a bug, if I recall correctly, that could have caused an infinite loop if the retry always fails. A retry is supposed to be used on transient failures - ones that you think you might be able to recover from, so validation errors are not really in that category. Maybe the retry isn't what you want anyway, and you could use a DefaultStepFactoryBean with a skipLimit? If you are looking for a callback on failure, the ItemRead/WriteListener will give you that in this case.