Announcement Announcement Module
No announcement yet.
How to re-run number of different jobs in a single sched from db in quartz scheduler. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to re-run number of different jobs in a single sched from db in quartz scheduler.

    Hi All,
    I have 10 batch jobs that will run in regular interval (every hour). I want to execute few completed jobs based on the business rules. If some job is having less data but it was completed without any fail. So I will maintain one audit table for jobs with less number of data, from that table i have to pass the job parameters such as job name and date to the scheduler to re-run it.

    I think spring batch 2.1.8 supports re-run option by incremental RunID. so we can re-run the completed job with same job parameters. I think this ID is maintained as versions.

    1. how to create dynamic schedulers from the db for these jobs?
    Creating multiple scheduler files is difficult and maintaining its too.
    2. how to execute these jobs in scheduler (quartz). Now am using bat files to execute the regular 10 jobs.
    3. how to pass a data from db to job schedulers.

    Is it possible to create a rerunJob with multiple jobs 1-10 with a single scheduler date 22/06/2011 04:00 and kill this job once done. This rerunJob scheduler job parameter values and rerunJob details will be created every hour based on audit table.

    I need how to execute this scenario in spring batch with quartz scheduler.

    Kindly let me know your valuable suggestions. Please help me.


  • #2
    How to achieve this ? Pls help me? Is quartz scheduler supports this ? Is any other scheduler supports?

    I need to rerun the completed jobs using RunID on regular interval until some time line. (say 12 hours). IF a job missed data means it was logged in audit table and it should be rerun from next hour on-wards to next 12 hours.

    Ex: I have 10 regular jobs starts on 22/06/2011 04:10 :05.


    Each have missing data on 4th hour so 10 jobs should rerun from 5th onwards to next 12 hours (4+12=16).

    Regular 10 jobs increment them for 5th hour job and it will go ,,,,,,,,,,,,,,,

    Then for 5th hour also i have 10 jobs with missed data, so again re-run it . whiling re-run it have 10 jobs for 5th hour and 10 jobs for 4th hour. and it will grow based on the missed data.

    again it will continue for 6,7 and so..... based on missing

    Based on audit table, i have to re-run the jobs.

    Check list of jobs missed for the date and hour and increment the date hour based on (db input next missed hour)
    1. Create dynamic job ReunnerJob with list of jobs to be re-runned.
    2. create dynamic schedulers and pass job parameteres.

    Pls help me...


    • #3
      Please reply me with a solution, did I explained my problem clearly. Is quartz scheduler supports it or any other scheduler?

      A basic approach is a Tasklet which creates a dynamic .bat files, execute and kill it for max possibilities 240jobs per hour from database.

      Please tell me a better solution for this problem.


      • #4
        I don't see any particular reason to use Quartz, but I also don't see any reason not to if you already use it (Spring native scheduling would probably be sufficient). The requirement is sort of clear, but why you think it's a problem is not. You don't want to run all the jobs in the same JVM? If not then I would prefer a service-oriented approach (e.g. deploy the job as a web service in a cluster) rather than messing around with Runtime.exec, or failing that, use Groovy AntBuilder to create you external process, so you have less OS-level crap to deal with.


        • #5
          Hi Dave,
          Thanks for your ideas. Could you please explain me with sample code, i can understand it exactly.


          • #6
            I am not clear, please explain with sample for native scheduling and deployment as web service call. Whats the use of these below schedulers in below link?


            • #7
              I haven't used all those tools by any means, but they are all a lot more heavyweight than the Spring native scheduling support ( You really have to choose which you want to use.


              • #8
                Currently I have 1 batch file with job details like jar file scheduler.xml job.xml how can i pass the values to the scheduler.xml from tables?
                In spring native how can i run the job based on the job parameters from tables.
                Pls give me examples. I can understand clearly.


                • #9
                  I have a Tasklet to create a dynamic scheduler file every hour from database log tables.

                  how can i execute it in command line:

                  The normal executions is like below for jobs A,B,C,D....... N for individual jar files.

                  java -cp -Xms512m -Xmx1024m -jar Ajob.jar file:C:/A/Resources/AResources/aScheduler.xml file:C:/A/Resources/AResources/aJob.xml

                  Here i have only one rerunscheduler for all jobs A,B,C,D,......N for all jobs.
                  So please tell me how can i run the batch jobs in command prompt like

                  java -cp -Xms512m -Xmx1024m -jar Ajob.jar,....... N.jar file:C:/A/Resources/AResources/rerunScheduler.xml file:C:/A/Resources/AResources/aJob.xml, ......NJob.xml

                  IS I am explained problem clearly, please guide me...

                  pls check the attachment.


                  • #10
                    Please give me some ideas for above doubt..