SSCS Job Scheduler
The job scheduler library allows other services to schedule callbacks in the future. For example, scheduler can call back to a specified handler next week Sunday at 2am.
Getting started
Prerequisites
Developing
Unit tests
To run all unit tests execute the following command:
./gradlew test
Code quality checks
We use checkstyle and PMD.
To run all checks execute the following command:
./gradlew check
Job management
The service manages its clients' jobs with Quartz.
Applications importing this project as a JAR will be required to use their own database.
This could be a PostgreSQL database for persisting those jobs. Also, Quartz can be configured
to run in cluster mode, i.e. the load will be distributed among multiple nodes, each
running different jobs.
Configuration Example
job.scheduler:
quartzProperties:
org.quartz:
scheduler:
instanceId: AUTO
dataSource:
jobscheduler:
driver: org.postgresql.Driver
URL: ${spring.datasource.url}
user: ${spring.datasource.username}
password: ${spring.datasource.password}
jobStore:
isClustered: true
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
dataSource: jobscheduler
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 8
retryPolicy:
maxNumberOfJobExecutions: ${MAX_NUMBER_OF_JOB_EXECUTIONS:5}
delayBetweenAttemptsInMs: ${DELAY_BETWEEN_JOB_ATTEMPTS_MS:15000}
Data security
As of now, job information is stored in an unencrypted form. This means that clients of this service must not include any sensitive information (tokens, passwords, personally identifiable information, etc.) in their requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.