【问题标题】:Pause and Resume Job Execution Spring Batch暂停和恢复作业执行 Spring Batch
【发布时间】:2019-04-09 11:23:57
【问题描述】:

这里有同样的问题-

Spring batch pause/resume vs stop/restart

我在春季检查了 BatchStatus 枚举,没有可用的状态 PAUSED,它仅作为用例提供,此处没有详细信息 -

https://docs.spring.io/spring-batch/2.1.x/cases/pause.html

【问题讨论】:

标签: spring-batch


【解决方案1】:

为此使用作业操作符,它是提供停止、重启、获取状态等功能的基本接口

public interface JobOperator {

List<Long> getExecutions(long instanceId) throws NoSuchJobInstanceException;

List<Long> getJobInstances(String jobName, int start, int count)
      throws NoSuchJobException;

Set<Long> getRunningExecutions(String jobName) throws NoSuchJobException;

String getParameters(long executionId) throws NoSuchJobExecutionException;

Long start(String jobName, String parameters)
      throws NoSuchJobException, JobInstanceAlreadyExistsException;

Long restart(long executionId)
      throws JobInstanceAlreadyCompleteException, NoSuchJobExecutionException,
              NoSuchJobException, JobRestartException;

Long startNextInstance(String jobName)
      throws NoSuchJobException, JobParametersNotFoundException, JobRestartException,
             JobExecutionAlreadyRunningException, JobInstanceAlreadyCompleteException;

boolean stop(long executionId)
      throws NoSuchJobExecutionException, JobExecutionNotRunningException;

String getSummary(long executionId) throws NoSuchJobExecutionException;

Map<Long, String> getStepExecutionSummaries(long executionId)
      throws NoSuchJobExecutionException;

Set<String> getJobNames();

}

这是一个例子

JOB_OPERATOR EXAMPLE

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-10
    • 2019-11-21
    • 1970-01-01
    • 2020-11-11
    • 1970-01-01
    • 2013-07-19
    相关资源
    最近更新 更多