【发布时间】:2018-08-09 16:39:52
【问题描述】:
重新启动作业时,不执行批处理,即不调用批处理的process() 方法。
是否有人有一些提示,为什么重新启动不执行任何批处理。我几乎尝试了所有组合,但没有进行任何更改以使重新启动正常工作。
重启工作是这样的 () 不会带来错误 - 但是会成功终止而不调用任何批处理 process() 方法。
我正在使用 wildfly-13.0.0.Final 和 jBeret。
我有一个带有这个 jox.xml 定义的简单 java 批处理作业。被调用的 batchlet 目前除了返回状态之外什么都不做。
<job id="job" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0" restartable="true">
<flow id="processing">
<step id="download" next="process">
<batchlet ref="download"/>
</step>
<step id="process" next="notify">
<batchlet ref="process"/>
<stop on="STOPPED" restart="notify" />
</step>
<step id="notify">
<batchlet ref="noify"/>
<end on="COMPLETED"/>
</step>
</flow>
</job>
bachlets的返回值为:
- 下载...完成
- 进程...已停止
- 通知...已完成
当使用jobOperator.start() 开始这项工作时,一切都按预期工作。
当使用jobOperator.restart() 重新启动已停止的作业执行时,作业会被执行,但不会调用任何批处理。
批处理看起来像这样
@Named
public class Notify extends AbstractBatchlet {
@Override
public String process() throws Exception {
return BatchStatus.COMPLETED.toString();
}
@Override
public void stop() throws Exception {
}
}
【问题讨论】:
标签: java spring-batch jsr352 jberet