Nagaraju
Nagaraju

Reputation: 83

spring boot batch-- How can we read Jobperameters from ItemReader<>?

need to fetch the job parameters in ItemReades from jobLancher.run(job, parameters); in to ItemReader<>

Spring Boot------

Upvotes: 1

Views: 32

Answers (1)

Nagaraju
Nagaraju

Reputation: 83

i did like below.

i created listener where i can monitor after/before batch job running.

in listener i created static method which is return JobExecution entity where as we can find job related parameters like below.

public class MyListener extends Job***Listener**{
private static Jobexceution jobExecution1;
@Override
p v beforeJob(Jobexceution jobExecution){
this.jobExecution1=jobExecution;
}
 p s JobExecution getJobExecution (){
  return jobExecution1;
 }
}

Upvotes: 1

Related Questions