I am passing time in my job parameters .After running my job , i can see in console my job started with time parameters :-
Job: [FlowJob: [name=DB2-SQL-LOAD56]] launched with the following parameters: [{Time=1590853755581}]
I am wondering how can i restart the job if my job fails because everytime when my job fails , it runs a new instance since it picks up the current time (passed as job parameter)
How do i restart my failed job with old time parameter(mentioned above) ?
Do i need to add logic to accept time parameter in my code ? if yes , how do I handle that ?
I have attached my code. I would really appreciate if someone can help me what am i missing here in order to restart my failed job.
@SpringBootApplication
public class Db2MySqlLoadApplication implements CommandLineRunner {
@Autowired
private JobLauncher jobLauncher;
@Autowired
private Job job;
public static void main(String args[]) {
SpringApplication.run(Db2MySqlLoadApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
JobParameters params = new JobParametersBuilder()
.addLong("Time" ,System.currentTimeMillis())
.toJobParameters();
jobLauncher.run(job, params);
}
}