Spring batch 在步骤后调用后发生页脚回调

Spring batch 在步骤后调用后发生页脚回调,spring-batch,Spring Batch,My spring batch writer实现了页脚回调和步骤执行侦听器,如下所示: public class MyItemWriter implements ItemWriter<MyBean>, FlatFileFooterCallback, StepExecutionListener, ItemStream public void writeFooter(Writer writer) throws IOException { this.one = "this is a te

My spring batch writer实现了页脚回调和步骤执行侦听器,如下所示:

public class MyItemWriter implements ItemWriter<MyBean>, FlatFileFooterCallback, StepExecutionListener, ItemStream
public void writeFooter(Writer writer) throws IOException {
this.one = "this is a test";
}

public ExitStatus afterStep(StepExecution stepExecution) {
File file = new File("myFile");
try {
      FileUtils.write(file, this.one);          
 } catch (IOException e) {
      e.printStackTrace();
   } 
  return null;
}
我的footerCallback和afterStep方法如下:

public class MyItemWriter implements ItemWriter<MyBean>, FlatFileFooterCallback, StepExecutionListener, ItemStream
public void writeFooter(Writer writer) throws IOException {
this.one = "this is a test";
}

public ExitStatus afterStep(StepExecution stepExecution) {
File file = new File("myFile");
try {
      FileUtils.write(file, this.one);          
 } catch (IOException e) {
      e.printStackTrace();
   } 
  return null;
}
很明显,我在footerCallBack中设置属性字符串one,然后在afterStep方法中使用它

但是,文件中写入的值为空

在调试时,我发现在writeFooter之前调用了afterStep方法


但这不是错吗?这一步不应该在页脚回调结束后才完成吗?

如果不深入了解细节,我将遵循您的结论,请创建一个Jira@MichaelLange:创刊于《吉拉》1892期。。。谢谢