Spring Boot Actuator does not ship a built-in endpoint that lists Spring Batch jobs. What you get out of the box is health, Micrometer metrics for jobs, steps and items (spring.batch.*), and the job and step history in the Spring Batch metadata tables. To manage jobs you add a small REST controller around JobOperator, or use a dashboard such as Spring Cloud Data Flow.
This guide shows the supported approach for Spring Boot 3.x with Spring Batch 5: metrics through Actuator, status from the job repository, and safe start, stop and restart operations. API names change in Spring Batch 6 (shipped with Spring Boot 4), so check the migration guide when you upgrade.
Add the Actuator and a metrics registry, then expose the endpoints you need:
Spring Batch registers Micrometer meters automatically when a MeterRegistry is present. The main ones are:
| Metric | Type | Meaning |
|---|---|---|
spring.batch.job | Timer | Duration of job executions, tagged with job name and status |
spring.batch.job.active | Long task timer | Jobs running right now |
spring.batch.step | Timer | Duration of each step |
spring.batch.item.read | Timer | Time spent reading items |
spring.batch.item.process | Timer | Time spent processing items |
spring.batch.chunk.write | Timer | Time spent writing chunks |
Query them at /actuator/metrics/spring.batch.job or scrape /actuator/prometheus. Some guides mention an /actuator/jobs endpoint or a JobEndpoint class. Neither exists in Spring Boot or Spring Batch.
By default Boot launches every Job bean at startup through JobLauncherApplicationRunner. For a service that starts jobs on demand or on a schedule, turn that off:
Define a job as usual:
Because Actuator has no job endpoint, write one. JobExplorer reads history, JobLauncher starts jobs, and JobOperator stops and restarts them.
Notes on this example:
JobLauncher runs synchronously by default, so the request waits for the job. For long jobs configure a TaskExecutorJobLauncher with a task executor so the call returns immediately.requestedAt, or Spring Batch refuses to start a second instance with identical parameters.stop is cooperative. The job stops after the current chunk, and the execution ends with status STOPPED, which can be restarted./batch/** with Spring Security. These are operational endpoints.Use Actuator health for liveness of the application and Micrometer for batch outcomes. Useful alert rules on the Prometheus metrics include:
spring.batch.job filtered by status="COMPLETED".status="FAILED".spring.batch.job.active or the timer's max.For a visual overview with restart buttons across many jobs, Spring Cloud Data Flow provides a dashboard, and Spring Boot Admin can show health and metrics for the application itself. The batch metadata tables (BATCH_JOB_EXECUTION, BATCH_STEP_EXECUTION) remain the source of truth, so a SQL query is also a legitimate way to inspect history.
JobInstanceAlreadyCompleteException: the same job and parameters already completed. Change a parameter.spring.batch.job.enabled=false.MeterRegistry bean exists and the endpoint is in the exposure list.STARTED after a crash: mark it failed or abandoned through JobOperator.abandon after confirming no process is running it.No. Spring Boot Actuator has no Spring Batch endpoint. Use Micrometer metrics and your own REST controller, or an external tool.
Call JobOperator.stop(executionId). The job finishes the current chunk and then stops with status STOPPED, and you can restart it later.
In the metadata tables of the configured DataSource, mainly BATCH_JOB_INSTANCE, BATCH_JOB_EXECUTION and BATCH_STEP_EXECUTION.
Yes. Expose /actuator/prometheus, scrape it with Prometheus, and chart spring.batch.job and spring.batch.step series (Prometheus renames dots to underscores).
Actuator provides health and Micrometer metrics for Spring Batch, but job control is your responsibility. Disable automatic start with spring.batch.job.enabled=false, expose a secured controller built on JobLauncher, JobExplorer and JobOperator, scrape spring.batch.* metrics with Prometheus, and alert on failed, missing or slow runs.