Suppose I want to build an API for (1) submitting jobs to be executed and (2) later get their result/status.
Now, the submit endpoint receives a payload and some headers. The payload is persisted through a custom JpaRepository and the headers are pushed into an instance of JobParameters (which is then fed to the JobLauncher). From what I know so far, there is a JobRepository that will end up persisting my JobParameters.
A. My first question on this design would be: should the JobRepository be used to persist the job payload instead of doing it in a custom JpaRepository?
B. I want access the JobParameters of a certain job (by job ID, which is given back when a job is submitted to the JobLauncher, through the JobExecution; this is standard Spring Batch stuff).
Is this possible from a normal bean (a @Service class)?
The JobRepository does not expose anything that access a job id and returns the job parameters associated with that.
There is a JobExecutionDao that, given an execution ID, could give me access to the JobParameters, but I cannot inject that into my beans.
Parameter <#> of constructor in required a bean of type 'org.springframework.batch.core.repository.dao.JobExecutionDao' that could not be found.
batch-web-spring-boot-starter
github.com/codecentric/spring-boot-starter-batch-web/blob/… you should be able to glean the relevant API (and then post the answer yourself). – Stefan Reisner