Do java Quartz Scheduler support Asynchronous job scheduling.If so,is it by default or have to customize jobs to run asynchronously.
Asked
Active
Viewed 4,931 times
4
-
What do you mean by "asynchronous job scheduling"? By default, jobs in Quartz are executed using different threads. – nobeh Jul 18 '12 at 14:09
-
2I think what you have asked is answered [here](http://stackoverflow.com/questions/11361939/quartz-thread-execution-parallel-or-sequential) – Abhishek bhutra Jul 18 '12 at 14:15
2 Answers
5
Not only it supports this behaviour but there is basically no other way. Once you schedule a job and a trigger (in any thread) this job will be executed asynchronously in a thread pool. You have some control over that thread pool like the number of threads.
Another issue is parallel execution of the same job. By default the same job can run in multiple threads started by different threads, unless the job is stateful.

Tomasz Nurkiewicz
- 334,321
- 69
- 703
- 674
-
One issue i came across in Quartz was... When a job under execution i cannot use the same scheduler instance to read the list of jobs, triggers, groups etc., until the job is executed. If i try to use scheduler.getGroupNames() at the time of a job execution i get Null Pointer Exception. Is there way to resolve this issue. Any help will be appreciated. – Sangram Anand Jul 20 '12 at 02:50
-
1@SangramAnand: sound like a bug in Quartz to me. Maybe posting as a separate question or even reporting a bug? – Tomasz Nurkiewicz Jul 20 '12 at 06:32
1
Yes and it should be by default. I am using Quartz in my Grails application for my website and it spins off new threads for each job.

skaz
- 21,962
- 20
- 69
- 98