Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 575 Bytes

File metadata and controls

12 lines (8 loc) · 575 Bytes

11.6 执行系统命令

许多批处理作业可能需要一个外部命令调用内部的批处理作业.这样一个过程可以分开调度,但常见的元数据对运行的优势将会丢失.此外,multi-step 作业需要分割成多个作业.

因此通常的 spring batch提供一个tasklet实现调用系统命令:

<bean class="org.springframework.batch.core.step.tasklet.SystemCommandTasklet">
    <property name="command" value="echo hello" />
    <!-- 5 second timeout for the command to complete -->
    <property name="timeout" value="5000" />
</bean>