Launching, Parameters & Metadata
Starting jobs and remembering what happened: the launcher, job parameters and identity, the metadata repository, restartability, idempotency, the operator API, and step-scoped late binding. This is the operational half of Spring Batch.
part ofSpring Frameworkoverview, primer and where to startread it →on this pageshowhide
explore
- JobLauncher5 questions
- JobParameters & Incrementer5 questions
- JobRepository & Metadata Schema5 questions
- Restartability5 questions
- Idempotency & Duplicate Runs4 questions
- JobOperator5 questions
- @StepScope / @JobScope & Late Binding5 questions
questions
page 2 of 2How are JobParameters validated and converted, and how would you enforce required parameters?
basics
~10 sAttach a JobParametersValidator to the job (DefaultJobParametersValidator for required/optional key checks, or a custom one) to fail fast on bad input. Conversion from string form uses a JobParametersConverter / ConversionService in Spring Batch 5.
In production, how would you wire up a JobOperator and expose it so operators can manage jobs (e.g., over JMX or an admin endpoint)? What are the pitfalls?
basics
~20 sDefine a SimpleJobOperator bean wired with JobLauncher, JobRegistry, JobRepository, and JobExplorer, and make sure every Job is registered in the JobRegistry so it can be found by name. Then expose the operator via a JMX MBean or a secured admin controller.
You inherit a nightly batch job that 'never resumes' after failures — it always reprocesses everything. Walk through the likely causes and how restart correctness depends on job/step design.
basics
~20 sMost often the job adds a unique identifying parameter (timestamp/UUID) each run, so every launch is a NEW JobInstance and there's nothing to resume. Other causes: readers with saveState=false or no ItemStream, an in-memory JobRepository losing state, or restartable=false.
showing 31–34 of 34