1.Problem Summary
After I run a job, I see the TABLE batch_step_context like the pic: screenshot of the table
The beautiful information of the FIELD short_context is:
{
"batch.taskletType": "com.a.b.job.config.BundleJobConfig$$Lambda$763/0x000000080070f840",
"batch.stepType": "org.springframework.batch.core.step.tasklet.TaskletStep"
}
How can I add extra information in it?
such as, after a job is finish, I want my FIELD short_context is like this:
{
"output": "hello world",
"batch.taskletType": "com.a.b.job.config.BundleJobConfig$$Lambda$763/0x000000080070f840",
"batch.stepType": "org.springframework.batch.core.step.tasklet.TaskletStep"
}
how can I add extra information like 'output'.
2.Part of My Code
@Configuration
public class AJobConfig {
private final JobBuilderFactory jobBuilderFactory;
private final StepBuilderFactory stepBuilderFactory;
@Autowired
public AJobConfig(JobBuilderFactory jobBuilderFactory, StepBuilderFactory stepBuilderFactory) {
this.jobBuilderFactory = jobBuilderFactory;
this.stepBuilderFactory = stepBuilderFactory;
}
@Bean
public Job aJob(Step aStep) {
return jobBuilderFactory.get("aJob")
.start(aStep)
.build();
}
@Bean
public Step aStep() {
return stepBuilderFactory.get("aStep")
.tasklet((contribution, chunkContext) -> {
System.out.println("hi");
return RepeatStatus.FINISHED;
})
.build();
}
}