I recently added the following JBeret extension modules to support batch job scheduling:
- jberet-schedule / jberet-schedule-executor
- base module for JBeret scheduling capability
- provides a ScheduledExecutorService-based job scheduler impl
- supports batch job scheduling in Java SE environment, using java.util.concurrent.ScheduledExecutorService
- supports batch job scheduling in Java EE, JBoss EAP & WildFly environment, using Java EE Concurrency Utils and javax.enterprise.concurrent.ManagedScheduledExecutorService
- supports single-action and repeatable job schedules
- jberet-schedule / jberet-schedule-timer
- extends jberet-schedule-executor module with a EJB-Timer-based job scheduler impl
- supports batch job scheduling in Java EE, JBoss EAP & WildFly environment, using EJB TimerService (persistent), or EJB Lite TimerService (non-persistent)
- supports single-action, repeatable, and calendar-based job schedules
- distributable, and supports schedule recovery and server restart
jberet-rest-api has been updated to include scheduling-related REST API. More details are in JBERET-224 (Add Job Scheduling API to jberet-rest-api)
More impl details can be found in JBERET-222 (Support Batch Job Scheduling)
2 sample webapps were added to demonstrate this new feature:
In addition, jberet-schedule-executor tests shows how to use job scheduling in Java SE environment.
Besides the above 3 built-in types of JobScheduler, one can also implement and specify your own job scheduler.
A comparison of job schedulers based on Java SE ScheduledExecutorService, Java EE Concurreny Utils ManagedScheduledExecutorService, and EJB Timer:
Scheduled Executor Service
Managed Scheduled Executor Service
Single action schedule
At most once
At least once
* ManagedScheduledExecutorService-based scheduler supports calendar-based single-action schedule, but does not support calendar-based repeatable schedule.
We hope this can be useful in your batch application development, and feedback, bug reports and other contributions are always welcome.