简体   繁体   English

Spring Batch:作业依赖性

[英]Spring Batch: Job dependencies

I need to save 3 files to DB: A, B, C. File B can not be inserted into DB before A, and file C can not be inserted before B. 我需要将3个文件保存到DB:A,B,C。文件B不能在A之前插入DB,文件C不能在B之前插入。
What would be the best approach to create dependencies between jobs? 在作业之间创建依赖关系的最佳方法是什么?

Write one job with 3 steps: in step1 write file A to DB, in step2 write file B and in step3 write file C. 通过3个步骤编写一个作业:在步骤1中将文件A写入DB,在步骤2中将文件B写入,在步骤3中将文件C写入。

<job id="myJob>
  <step id="step1" next="step2"><!-- write file A --></step>
  <step id="step2" next="step3"><!-- write file B --></step>
  <step id="step3"><!-- write file C --></step>
</job>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM