BATCH-1396: added step scope to skip policy in chunk parser
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<step id="playerload" next="gameLoad">
|
||||
<tasklet>
|
||||
<chunk reader="playerFileItemReader" writer="playerWriter"
|
||||
commit-interval="#{jobParameters['commit.interval']}" />
|
||||
commit-interval="#{jobParameters['commit.interval']}"/>
|
||||
</tasklet>
|
||||
</step>
|
||||
<step id="gameLoad" next="playerSummarization">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<step id="playerload" next="gameLoad">
|
||||
<tasklet>
|
||||
<chunk reader="playerFileItemReader" writer="playerWriter" commit-interval="${job.commit.interval}"
|
||||
skip-limit="100000">
|
||||
skip-limit="#{jobParameters['skip.limit']}">
|
||||
<skippable-exception-classes>
|
||||
<include class="org.springframework.dao.DataAccessException" />
|
||||
</skippable-exception-classes>
|
||||
|
||||
@@ -82,13 +82,15 @@ public class FootballJobSkipIntegrationTests {
|
||||
catch (Exception e) {
|
||||
// Ignore (wrong platform)
|
||||
}
|
||||
JobExecution execution = jobLauncher.run(job, new JobParametersBuilder().addLong("run.id", 1L)
|
||||
JobExecution execution = jobLauncher.run(job, new JobParametersBuilder().addLong("skip.limit", 0L)
|
||||
.toJobParameters());
|
||||
assertEquals(BatchStatus.COMPLETED, execution.getStatus());
|
||||
for (StepExecution stepExecution : execution.getStepExecutions()) {
|
||||
logger.info("Processed: " + stepExecution);
|
||||
}
|
||||
execution = jobLauncher.run(job, new JobParametersBuilder().addLong("run.id", 2L).toJobParameters());
|
||||
// They all skip on the second execution because of a primary key violation
|
||||
execution = jobLauncher.run(job, new JobParametersBuilder().addLong("skip.limit", 100000L)
|
||||
.toJobParameters());
|
||||
assertEquals(BatchStatus.COMPLETED, execution.getStatus());
|
||||
for (StepExecution stepExecution : execution.getStepExecutions()) {
|
||||
logger.info("Processed: " + stepExecution);
|
||||
|
||||
Reference in New Issue
Block a user