Announcement Announcement Module
Collapse
No announcement yet.
How to skip a item ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to skip a item ?

    Hello,

    I am using Spring 2.0 M3 and I have some difficulties to configure retry policy, skip policy and others.

    In my business ItemProcessor, I throw a specific exception if I don't find a value in a parameter Map (No matter).
    Next, what I want is to skip this item and process the next one.

    I use the following configuration but the treatment stops immediately when the exception is thrown.

    PHP Code:
        <bean id="traitementStep" parent="faultTolerantItemOrientedStep">
            <
    property name="throttleLimit" value="100" />
            <
    property name="itemReader" ref="evenementItemReader" />
            <
    property name="itemProcessor" ref="traitementItemProcessor" />
            <
    property name="itemWriter" ref="imageContratItemWriter" />
            <
    property name="listeners">
                <list>
                    <
    ref bean="reportStepListener" />
                    <
    ref bean="ajoutERItemProcessor" />
                    <
    ref bean="determinerPeriodeValiditeItemProcessor" />
                    <
    ref bean="skipItemListener" />
                </list>
            </
    property>
            <
    property name="skippableExceptionClasses">
                <list>
                    <
    value>com.cegedimactiv.p2d.batch.importimage.exception.SkipException</value>
                </list>
            </
    property>
            <
    property name="skipLimit" value="1000000" />
            <
    property name="retryPolicy">
                <
    bean class="org.springframework.batch.retry.policy.AlwaysRetryPolicy" />
            </
    property>
        </
    bean
    Has anybody a idea ?
    I think I misunderstood something but i don't know what.

    Thanks

  • #2
    It seems like it should work. Are you sure the classname is accurate? It's kind of hard since it's string matching. (Hopefully with 2.0 namespace support spring ide can help with that in the future)

    Comment

    Working...
    X