2

I have 2 jobs named Job A and Job B,both are chained in quartz scheduler which fires job A first and then Job B.

I'm generating a String value in Job A's step listener which needs to be passed to Job B.If I put the value in Job A's execution context it can not be accessed in Job B.

1) Is there a way I can Inject Quartz jobExecutionContext to job ?

2)Can I create a parent JOB P for A and B ,implement my logic in its step and inject it to both child Job ?

3)Is there any other way around ?

Please guide towards the right approach

Maverick
  • 238
  • 1
  • 7
  • 18
  • Do you have any control over the scheduling logic? Could you retrieve the string value from the execution context of job A and then pass it as a job parameter to job B? Or you could also use a JobStep, see this section of the reference guide: http://docs.spring.io/spring-batch/trunk/reference/html/configureStep.html#external-flows – Jimmy Praet Feb 12 '15 at 19:41
  • Is it option for you to model more tables in DB which is holding batch job meta data? If it is you can put something from one job and read it in second job, that can complicate data management but might solve your problem. We used that approach for step to step large data passing. Here is my answere on that topic in option 3 http://stackoverflow.com/questions/2292667/how-can-we-share-data-between-the-different-steps-of-a-job-in-spring-batch/29048403#29048403 – Nenad Bozic Mar 17 '15 at 16:37

0 Answers0