diff --git a/docs/src/site/docbook/reference/execution.xml b/docs/src/site/docbook/reference/execution.xml index 73a178267..d428b9ffd 100644 --- a/docs/src/site/docbook/reference/execution.xml +++ b/docs/src/site/docbook/reference/execution.xml @@ -1212,8 +1212,8 @@ factory beans through the streams property, as illustrated below: - <bean id="step1" parent="simpleStep" - class="org.springframework.batch.core.step.item.StatefulRetryStepFactoryBean"> + <bean id="step1" + class="org.springframework.batch.core.step.item.SkipLimitStepFactoryBean"> <property name="streams" ref="fileItemReader" /> <property name="itemReader"> <bean @@ -1361,6 +1361,36 @@ was attempted to be written will be provided, so that they can be logged. + +
+ SkipListener + + Both ItemReadListener and + ItemWriteListner provide a mechanism for + being notified of errors, but neither one will inform you that a + record has actually been skipped. + onWriteError, for example, will be called + even if an item is retried and successful. For this reason, there is + a separate interface for tracking skipped items: + + + public interface SkipListener extends StepListener { + + void onSkipInRead(Throwable t); + + void onSkipInWrite(Object item, Throwable t); + } + + + + onSkipInRead will be called whenever + an item is skipped while reading. It should be noted that rollbacks + may cause the same item to be registered as skipped more than once. + onSkipInWrite will be called when an item + is skipped while writing. Because the item has been read + successfully (and not skipped), it is also provided the item itself + as an argument. +