Spring batch Spring批处理编写器,跳过两次调用处理器?

Spring batch Spring批处理编写器,跳过两次调用处理器?,spring-batch,Spring Batch,关于skip,我有一个非常基本的问题。我正在使用spring示例提供的spring batch simple cli项目,并试图理解跳过行为。这有一个从字符串数组读取的非常基本的示例读取器(我将其修改为从Hellowworld 1到Hellowworld 10的10个字符串列表中读取)和一个登录到控制台的基本编写器。writer在每次写入时抛出java.lang.Exception。 我在作业配置中添加了4的跳过限制。一旦到达Hellowworld 5,作业将按预期停止。 但无论何时writer

关于skip,我有一个非常基本的问题。我正在使用spring示例提供的spring batch simple cli项目,并试图理解跳过行为。这有一个从字符串数组读取的非常基本的示例读取器(我将其修改为从Hellowworld 1到Hellowworld 10的10个字符串列表中读取)和一个登录到控制台的基本编写器。writer在每次写入时抛出java.lang.Exception。 我在作业配置中添加了4的跳过限制。一旦到达Hellowworld 5,作业将按预期停止。 但无论何时writer抛出异常,writer都会立即用相同的项回调。我的问题是,为什么两次给作者打电话?我希望跳过此项?有什么我不知道的吗

<job id="job1" xmlns="http://www.springframework.org/schema/batch" incrementer="jobParametersIncrementer">
    <step id="step1" parent="simpleStep">
        <tasklet>
            <chunk reader="reader" writer="writer" skip-limit="4" >
                <skippable-exception-classes>
                    <include class="java.lang.Exception" />
                </skippable-exception-classes>
            </chunk>
        </tasklet>
    </step>
</job>

这很可能是由默认功能引起的,其中spring batch回滚块并再次重试每个块项(在本例中只有一项)


我的错,我没有意识到这一点。