Mar 11th, 2008, 10:39 PM
StatefulRetryStepFactoryBean and ItemRecoverer
forgive me if this has alredy been answered.
i have a case where a StatefulRetryStepFactoryBean has been injected with a RetryPolicy of 3 max attempts.
upon the exhaustion of the 3 retries i would like the ItemReader a chance to recover.
the javadoc suggests that an ItemRecoverer would provide a call back to the ItemReader in the above case.
is there an API that to failcilitate this?
alternatively looking at the src it seems that an instance ItemReaderRetryCallback is created during configuration. This ItemReaderRetryCallback has a getRecoverer() method that gets called when recovery is required (exhaustion of retries). this method attempts to discriminate the member reader or writer as instances of ItemRecoverers. However, the injected instances (which are ItemRecoverer instances) are wrapped by a delagator which itself is not an ItemRecoverer and in my case getRecoverer() will always return null and thus will not have a change to recover
is there a way i can acheive my requirements?
attached is the bean definition
if you need any more info please let me know and i'll do what i can
thanks in advance
Last edited by wawrick.mayson; Mar 11th, 2008 at 11:33 PM.
Reason: added attachment
Mar 12th, 2008, 02:47 AM
StatefulRetryStepFactoryBean has a setItemRecoverer() property setter. I think this may have been added after m5, because (as you have noticed) it was basically a bug that it was missing.