From 24285c78857f895bf943e7415e917fa6b98e8921 Mon Sep 17 00:00:00 2001 From: Fabio Formosa Date: Wed, 3 Nov 2021 00:01:45 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 89 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index c5d801c..240383a 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,26 @@ # QUARTZ MANAGER Quartz Manager is a library you can import in your spring webapp to easily enable the [Quartz Scheduler](http://www.quartz-scheduler.org/) and to control it by REST APIs or by a UI Manager Panel (angular-based). -Your Spring Webapp should provide the java class of the job you want schedule. Importing the Quartz Manager your project will have the REST API and (optionally) the UI to launch and control the job. +Your Spring Webapp should provide the java class of the job you want to schedule. Including the Quartz Manager lib, your project will provide the REST API and (optionally) the UI to launch and control the job. The UI Dashboard is composed by a management panel to set the quartz trigger, to start/stop the scheduler and a log panel with a progress bar to display the job output. ![](https://github.com/fabioformosa/quartz-manager/blob/master/quartz-manager-parent/quartz-manager-web-showcase/src/main/resources/quartz-manager-2-screenshot_800.PNG) -## HOW IT WORKS -* Set up the trigger into the left sidebar in terms of: daily frequency and and max occurrences. -* Press the start button -* The GUI manager updates in real time the progress bar and reports all logs of your quartz job. +## FEATURES +* You can set up a simple trigger in terms of: daily frequency and and max occurrences. +* You can start, pause and resume the quartz job clicking the play button. +* Leveraging on an active web-socket, the `Quartz-Manager-UI` updates in real time the progress bar and it displays the list of the latest logs produced by your quartz job. +* You can enable a secure layer, if your project doesn't have any, to give access only to authenticated users. +* You can enable a persistent layer, to persist the config and the progress of your trigger, in postgresql database. + +## LIMITATIONS +Initially `Quartz-Manager` was born like a pet-project to start&monitor a repetitive job. Now there's a work-in-progress roadmap to convert it in full-fledged library to manager a [Quartz Scheduler](http://www.quartz-scheduler.org/). +At the moment, these are the limitations: + +* Quartz-Manager imports [Quartz Scheduler](http://www.quartz-scheduler.org/) as well, you cannot import Quartz-Manager in a project which has already imported [Quartz Scheduler](http://www.quartz-scheduler.org/). +* You cannot start multiple triggers or multiple jobs. +* You can start only a simple trigger based on a daily frequency and a max number of occurencies. +* You cannot start/stop a trigger, but the entire scheduler. ## QUICK START @@ -28,33 +39,32 @@ MAVEN it.fabioformosa.quartz-manager quartz-manager-starter-api - 3.0.1 + 3.1.0 it.fabioformosa.quartz-manager quartz-manager-starter-ui - 3.0.1 + 3.1.0 ``` GRADLE ``` -compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-api', version: '3.0.1' +compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-api', version: '3.1.0' //optionally -compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-ui', version: '3.0.1' +compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-ui', version: '3.1.0' ``` -Import `quartz-manager-starter-ui` as well, if you want to use the Quartz Manager API by the angular frontend. +Import `Quartz-Manager-Starter-UI` as well, if you want to use the Quartz Manager API by the angular frontend. * **add a `quartz.properties` file in the classpath (`src/main/resources`)** ``` org.quartz.scheduler.instanceName=example -org.quartz.scheduler.instanceId=AUTO org.quartz.threadPool.threadCount=1 ``` `quartz.properties` is a configuration file required by [Quartz Scheduler](http://www.quartz-scheduler.org/). For further details, click [here](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/configuration/). @@ -80,10 +90,6 @@ Extend the super-class `AbstractLoggingJob` quartz: enabled: true -job: - frequency: 4000 - repeatCount: 19 - quartz-manager: jobClass: ``` @@ -100,7 +106,9 @@ If you've imported the `quartz-manager-starter-ui` you can open the UI at URL: (Change the port and the contextPath accordingly with the setup of your webapp) -* **Security** +## HOW-TO + +* **HOW-TO ENABLE A SECURITY LAYER** If you want enable a security layer and allow the access to the REST API and to the UI only to authenticated users, add the dependency: MAVEN @@ -109,14 +117,14 @@ MAVEN it.fabioformosa.quartz-manager quartz-manager-starter-security - 3.0.1 + 3.1.0 ``` GRADLE ``` -compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-security', version: '3.0.1' +compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-security', version: '3.1.0' ``` and in your application.yml: @@ -148,6 +156,38 @@ quartz-manager: ``` +* **HOW-TO ENABLE A PERSISTENCE LAYER** +If you don't want to lose your scheduler config and the progress of your trigger, when you stop&start your webapp, you have to enable a security layer which persists data on a postgresql database. The `quartz-manager-persistence-module` needs a postgresql datasource to create its tables. To import the `quartz-manager-persistence-module`, please add the following dependency: + +MAVEN + +``` + + it.fabioformosa.quartz-manager + quartz-manager-starter-persistence + 3.1.0 + +``` + +GRADLE + +``` +compile group: 'it.fabioformosa.quartz-manager', name: 'quartz-manager-starter-persistence', version: '3.1.0' +``` + +and in your application.yml: + +``` +quartz-manager: + persistence: + quartz: + datasource: + url: "jdbc:postgresql://localhost:5432/quartzmanager" + user: "quartzmanager" + password: "quartzmanager" + +``` + * **DEMO** Take a loot to the project [Quartz-Manager Demo](https://github.com/fabioformosa/quartz-manager-demo), it is an example of how-to: @@ -157,13 +197,15 @@ Take a loot to the project [Quartz-Manager Demo](https://github.com/fabioformosa * add a secure layer to allow the API only to logged users * schedule a custom job (a dummy `hello world`) + ## ROADMAP Open the [Project Roadmap](https://github.com/fabioformosa/quartz-manager/projects) to take a look at the plan of Quartz Manager. Next steps in the roadmap are: -* to add a persistent layer to save all job setup. +* Give to change to import `quartz-manager` in projects which have already imported [Quartz Scheduler](http://www.quartz-scheduler.org/) +* Manage multiple triggers and jobs +* Redesign the API and re-styling the UI * to add a complete setup UI panel for quartz, in term of cronjobs and multiple jobs. -* to add CI/CD pipeline to ease the deploy pulling a docker container. * Enabling adapters for integrations: kafka, etc. @@ -171,8 +213,9 @@ Next steps in the roadmap are: ### PROJECT STRUCTURE * `quartz-parent/quartz-manager-starter-api` is the library that can be imported in webapp to have the quartz-manager API. -* `quartz-parent/quartz-manager-starter-ui` is a maven module to build and package the angular frontend in a webjar. -* `quartz-parent/quartz-manager-starter-security` is ther library that can be imported in a webapp to have a security layer (login) over the quartz-manager API. +* `quartz-parent/quartz-manager-starter-ui` is a maven module in charge to build and package the angular frontend in a webjar. +* `quartz-parent/quartz-manager-starter-security` is a library that can be imported in a webapp to have a security layer (login) over the quartz-manager API. +* `quartz-parent/quartz-manager-starter-persistence` is a library that can be imported in a webapp to persist the config and the progress of the trigger a Postgresql database. * `quartz-parent/quartz-manager-web-showcase` is an example of webapp that imports quartz-manager-api. Useful to develop the frontend started locally with the webpack dev server. * `quartz-frontend` is the angular app that interacts with the Quartz Manager API. @@ -220,7 +263,7 @@ Replace the dummy job (class: `it.fabioformosa.quartzmanager.jobs.SampleJob`) wi * quartz-manager backend context path (default `/quartz-manager`) and port (default `8080`): `/quartz-manager/src/main/resources/application.properties` ## HOW TO BROWSE REST API DOC -Swagger has been added as library. So, you can get REST API doc opening: [http://localhost:8080/quartz-manager/swagger-ui.html](http://localhost:8080/quartz-manager/swagger-ui.html) +Swagger has been added as library. So, you can get REST API doc opening: [http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html) ## Tech Overview From 870a813c61ddb42a8bfc027b7746b54e5f3547dd Mon Sep 17 00:00:00 2001 From: Fabio Formosa Date: Wed, 3 Nov 2021 00:09:21 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 240383a..ca2d119 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ At the moment, these are the limitations: * You can start only a simple trigger based on a daily frequency and a max number of occurencies. * You cannot start/stop a trigger, but the entire scheduler. +Take a look a the [Project Roadmap](https://github.com/fabioformosa/quartz-manager/projects) and feel free to open an issue or add a commment on an existing one, to give your feedback about planned enhancements. Your opinion is important to understand the priority. + ## QUICK START * **Requirements** @@ -109,6 +111,7 @@ If you've imported the `quartz-manager-starter-ui` you can open the UI at URL: ## HOW-TO * **HOW-TO ENABLE A SECURITY LAYER** + If you want enable a security layer and allow the access to the REST API and to the UI only to authenticated users, add the dependency: MAVEN @@ -157,6 +160,7 @@ quartz-manager: ``` * **HOW-TO ENABLE A PERSISTENCE LAYER** + If you don't want to lose your scheduler config and the progress of your trigger, when you stop&start your webapp, you have to enable a security layer which persists data on a postgresql database. The `quartz-manager-persistence-module` needs a postgresql datasource to create its tables. To import the `quartz-manager-persistence-module`, please add the following dependency: MAVEN @@ -188,6 +192,10 @@ quartz-manager: ``` +* **HOW-TO BROWSE REST API DOC** + +Swagger has been added as library. So, you can get REST API doc opening: [http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html) + * **DEMO** Take a loot to the project [Quartz-Manager Demo](https://github.com/fabioformosa/quartz-manager-demo), it is an example of how-to: @@ -262,9 +270,6 @@ Replace the dummy job (class: `it.fabioformosa.quartzmanager.jobs.SampleJob`) wi * Credentials: To change admin's password, set ENV var `quartz-manager.account.pwd` * quartz-manager backend context path (default `/quartz-manager`) and port (default `8080`): `/quartz-manager/src/main/resources/application.properties` -## HOW TO BROWSE REST API DOC -Swagger has been added as library. So, you can get REST API doc opening: [http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html) - ## Tech Overview **Backend Stack** Java 8, Spring Boot 2.1.4 (Spring MVC 5.1.6, Spring Security 5.1.5, Spring AOP 5.1.6), Quartz Scheduler 2.3.1 @@ -279,7 +284,7 @@ From quartz manager ver 2.x.x, the new structure of project is: * REST API backend * Single Page Application frontend (angular 9) -(The previous version of quartz manager was a monolithic backend that provided also frontend developed with angularjs 1.6.x. You can find it at the branch 1.x.x) +(The first version of quartz manager was a monolithic backend that provided also frontend developed with angularjs 1.6.x. You can find it at the branch 1.x.x) ## Contributes