How to get JobParameter and JobExecutionContext in the ItemWriter?
Implementing StepExecutionListener is one way. In fact that’s the only way in Spring Batch 1.x. Starting from Spring Batch 2, you have another choice: You can inject whatever entries in Job Parameters and Job Execution Context to your item writer. Make your item writer with step scope, then make use of expression like #{jobParameters[‘theKeyYouWant’]} or … Read more