2

我想在我的应用程序中创建一个 UI,用于调用 spring-batch(单独运行)作业并在该 UI 中显示诸如历史记录等作业详细信息。您可以使用 REST 从其他应用程序调用 spring-batch 的作业。我们也可以类似地检索工作的其他信息(历史等)吗?

4

1 回答 1

2

您可以在远程服务器上部署 spring batch admin 并使用它的 REST json API

/configuration  GET Form for upload of Job configuration file
/files  GET List uploaded data files
/files  POST    Upload a new file (in a multipart form request) with path= and file= paremeters.
        /files  DELETE  Remove a file that was previously uploaded. Add pattern= parameter to narrow down to a subset of existing resources.
/files/{path}   GET Download a previously uploaded file. The path can contain directory separators.
        /home   GET List the resources available
/job-configuration  POST    Upload a Job configuration file as a String request body
/jobs   GET List the jobs known to the application. If they are configured in this application they are launchable, otherwise not (i.e. if they have been executed offline)
/jobs/executions    GET List all the job executions, in order of most recent to least.
/jobs/executions    DELETE  Stop all job executions
/jobs/executions/{jobExecutionId}   GET Show the JobExecution with the id provided
/jobs/executions/{jobExecutionId}   DELETE  Stop the JobExecution with the id provided. Add abort=true parameter to abort an already stopped or failed job.
/jobs/executions/{jobExecutionId}/steps GET List the StepExecutions of the JobExecution with the id provided
/jobs/executions/{jobExecutionId}/steps/{stepExecutionId}   GET Inspect the StepExecution with the id provided
/jobs/executions/{jobExecutionId}/steps/{stepExecutionId}/progress  GET Monitor the progress of the StepExecution with the id provided
/jobs/{jobName} GET List the JobInstances of the job name provided
/jobs/{jobName} POST    Execute the job with the name provided and parameters provided as a String (stringified Properties as per the CommandLineJobRunner)
/jobs/{jobName}/executions  GET List the JobExecutions for the job name provided
/jobs/{jobName}/{jobInstanceId}/executions  GET List the JobExecutions for the job instance with the id provided
/jobs/{jobName}/{jobInstanceId}/executions  POST    Stop the JobExecutions for the job instance with the id provided
/files.json GET
/home.json  GET
/job-configuration.json POST
/job-restarts.json  POST
/jobs.json  GET
/jobs/executions.json   GET
/jobs/executions.json   DELETE
/jobs/executions/{jobExecutionId}.json  GET
/jobs/executions/{jobExecutionId}.json  DELETE
/jobs/executions/{jobExecutionId}/steps/{stepExecutionId}.json  GET
/jobs/{jobName}.json    GET
/jobs/{jobName}.json    POST
/jobs/{jobName}/executions.json GET
/jobs/{jobName}/{jobInstanceId}.json    GET
/jobs/{jobName}/{jobInstanceId}/executions.json POST
于 2013-03-19T16:15:53.723 回答