-
Notifications
You must be signed in to change notification settings - Fork 201
job scheduling
Easy Batch jobs implement the java.util.concurrent.Callable
interface so they can be easily scheduled using a java.util.concurrent.ScheduledExecutorService
:
Job job = ..;
ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5);
ScheduledFuture scheduledFuture = scheduledExecutorService.schedule(job, 5, TimeUnit.SECONDS);
In this example, the job will be scheduled to run in 5 seconds.
The advantage of java.util.concurrent.ScheduledExecutorService
is that it allows you to schedule jobs without requiring any third party library. But this service is limited in terms of scheduling features. For example, it does not support cron expressions. But you can always schedule jobs with any Java based scheduler like Quartz.
Easy Batch used to provide a module called easybatch-quartz
that acted as bridge between Easy Batch jobs and Quartz jobs. However, this module has been removed starting from v6.0.0. The bridge classes EasyBatchJob
and EasyBatchJobFactory
can be found in the Quartz tutorial and can be copied if needed. The tutorial shows how to use Quartz to schedule Easy Batch jobs.
Easy Batch is created by Mahmoud Ben Hassine with the help of some awesome contributors
-
Introduction
-
User guide
-
Job reference
-
Component reference
-
Get involved