Welcome to Scheduling service, the follow document provides an overview of the service. Scheduling service provides REST based interface on top of quartz scheduler along with additional functionality of persisting each scheduled run in db.
- Java 17
- Python 3
- PostgreSQL 11
- Spring Boot 2
- Junit ( Unit Testing )
- Karate ( Component/Integration Tests )
- Test Containers ( Component/Integration Tests )
If you have below requirements, then scheduling service is the right fit for you
- Want to run a scheduler outside of application code base
- Need rest base easy interface to schedule new tasks
- Tasks are Http/Curl based and execution of the task happens outside
- Login to psql shell and create db tables
make psql
dev=# \i deployment/db_migrations/quartz_table_postgres.sql
-
To reset db
make reset
-
Set following env variables for db, username and password using
. ./set-env.sh
. It will set following env variables , referred in spring application.yml
export db=dev
export dbuser=dev
export dbpassword=dev
- Create jar file and run scheduling service
mvn clean install
java -jar ./scheduling-server/target/scheduling-server-<version>-jar-with-dependencies.jar
You might have noticed that there is a module in the project scheduling-mockservice
written in python, it is nothing but a test double(stub), this mock service stores data like
- Schedule execution
- Complete request with time
- Supports delayed response
this is then used in integration tests to verify the schedule execution, without this we can only test if the schedule was fired but not if it every reached the target or not.
Build and install Scheduling mockservice docker image locally
cd scheduling-mockservice
docker build -t scheduling-mockservice .
scheduling-integration-test/src/test/java/com/mediaiq/caps/platform/scheduling/RunnerTest.java
For automated build as of now we have integrated CircleCI
which when a PR is merged to main branch will do below tasks
- Run the build
- Run unit tests
- Perform secret scan
//TODO: Add complete pipeline with running component tests and auto publish of jar to maven