Results 1 to 2 of 2

Thread: How to skip a item ?

  1. #1
    Join Date
    Dec 2008
    Location
    Toulouse, France
    Posts
    22

    Question 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. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    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)

Posting Permissions

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