Can we write a Spring Batch Job Without ItemReader and ItemWriter

前端 未结 1 666
迷失自我
迷失自我 2020-12-11 06:04

In my project, I have written a Quartz scheduler with Spring Batch 2.2.

As per my requirement, I want to run a scheduler to fetch application config property to refr

相关标签:
1条回答
  • 2020-12-11 06:37

    Use a Tasklet

    <job id="reportJob">
      <step id="step1">
        <tasklet ref="MyTaskletBean" />
      </step>
      <!-- Other config... -->
    </job> 
    
    
    
    class MyTasklet implements Tasklet {
      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
      }
    }
    

    You can read more on Tasklet at chapter 5.2 from official doc

    0 讨论(0)
提交回复
热议问题