Scheduler Application Using React & Spring Boot
This document describes how to create, change and cancel job scheduler with UI screens using reactJS and spring boot.
The technologies used in this application are given below.
* ReactJS * Typescript * Webpack
* Maven * Spring Boot * Spring Data JPA * Quartz Scheduler * H2 DB (InMemory)
Make sure to install the below tools and set the path in the system before proceeding to quick deployments.
maven requires JAVA_HOME variable, kindly follow the path setup given below.
In order to check the priority job execution, I have considered frequency as corn expression (String) because I have tried considering frequency as seconds (number) but there is a difference in seconds/milliseconds while trying to create the same Job frequency twice.
For Example, I have chosen 30 seconds as a frequency for JOB1
Let assume JOB1 scheduled at Wed Dec 02 16:55:48 GST 2019 and the following are subsequent execution.
|ScheduledFireTime||Wed Dec 02 16:56:01 GST 2019|
|NextFireTime||Wed Dec 02 16:56:31 GST 2019|
|ScheduledFireTime||Wed Dec 02 16:56:31 GST 2019|
|NextFireTime||Wed Dec 02 16:57:01 GST 2019|
|ScheduledFireTime||Wed Dec 02 16:57:01 GST 2019|
|NextFireTime||Wed Dec 02 16:57:31 GST 2019|
You can see jobs are running at every 30 seconds. And, I tried to schedule JOB2 with the highest priority with same 30 seconds frequency but I can’t schedule due to the second’s difference.
Recommended options for testing priority job execution - Please choose 1 or 2 or 5 or 10-minute frequency
Not completed items from the requirement
Sorting done only by priority ascending order and not done for enqueuing order due to some grouping issue from H2 DB.
get a frequency (default 0 secs, which means scheduler is disabled) - due to some limitations I have chosen corn expression.
Source Code Download
If you have the GIT you can clone the application using the below link else use the direct download link.
git clone https://github.com/mohancse1707/mk-scheduler-webapp.git
Quick Deployment Steps
After setting Java & Maven in the path, execute the below command to start the application.
once started hit this URL: http://localhost:8080/scheduler/#/
For Development & Contributions
Open two-terminal or command-line shell then navigate to application path and execute the below script.
npm install && npm run start
Server log before changing the priority jobs
Server log after changing the priority and en queuing jobs