Results 1 to 10 of 14

Thread: Processor missed call in a retry

Threaded View

  1. #1

    Default Processor missed call in a retry

    Hello,

    We are facing a behaviour that we cannot understand. In the code bellow, that's the parent step our test step. We've created 3 kinds of exceptions:
    • Fatal Exceptions: if a reader, processor, writer throws that exceptions, the batch is immediately in failure
    • Ignorable Exceptions: the batch can retry to re-process, or re-write, the skip policy returns true for that kind of exceptions
    • Non ignorable exception: the batch can retry, but the skip policy doesn't skip these exceptions.


    Code:
    	<bean id="abstractGenericStep" class="org.springframework.batch.core.step.item.FaultTolerantStepFactoryBean" abstract="true">
    		<property name="transactionManager" ref="transactionManager" />
    		<property name="jobRepository" ref="jobRepository" />
    		<property name="backOffPolicy" ref="timeIntervalPolicy" />
    		<property name="retryPolicy">
    			<bean id="defaultRetryPolicy" class="org.springframework.batch.retry.policy.CompositeRetryPolicy">
    				<property name="policies">
    					<set>
    						<ref bean="timeoutRetryPolicy" />
    						<ref bean="attemptsCounterRetryPolicy" />
    						<bean id="exceptionsFilterRetryPolicy" class="com.bsb.sf.batch.service.exception.ExceptionsFilterRetryPolicy">
                                   <property name="batchExceptionManager" ref="batchExceptionManager" />
                            </bean>
    					</set>
    				</property>
    			</bean>		
    		</property>
    		<property name="skipPolicy" ref="defaultSkipPolicy" />
            <property name="allowStartIfComplete" value="false" />
    	</bean>
    The "timeoutRetryPolicy" and "attemptsCounterRetryPolicy" are provided by Spring Batch (org.springframework.batch.retry.policy.TimeoutRet ryPolicy and org.springframework.batch.retry.policy.SimpleRetry Policy) while "exceptionsFilterRetryPolicy" is our own retry policy. It's used to returns false to fatal exceptions, otherwise true. The default skip policy skips ignorable exceptions and doesn't skip non ignorable exceptions.


    We have a commit-interval of 5. The first five items are written correctly. We throw an exception when the batch writes the 6th and 7th items. That exception is a fatal exception. So, the batch must stop, unfortunately, the processor is called to process the 6th. A RetryExhaustedException is thrown after its process and the batch is stopped.


    Is our configuration correct ?
    Last edited by sebge2; Mar 8th, 2010 at 10:47 AM.

Posting Permissions

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