bassista / quartz-shedlock-migration

Quartz Shedlock Migration Sample Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quartz Shedlock Migration

Overview

Quartz Shedlock Migration is a Java/Spring Boot project that utilizes Quartz Scheduler and Shedlock to provide distributed lock functionality for scheduled tasks. This project is built using Maven and requires JDK 21 or later.

Features

  • Integration of Quartz Scheduler for job scheduling.
  • Use of Shedlock for distributed lock management.
  • Maven for project build and dependency management.
  • Developed and tested with JDK 21.

Prerequisites

Make sure you have the following installed on your machine:

Getting Started with Maven

1. Clone the repository:

git clone https://github.com/korkutkose/quartz-shedlock-migration.git
cd quartz-shedlock-migration

2. Install and Run The Application:

mvn clean install
mvn spring-boot:run 

3. Enable Different Profile

  • By default, the application runs with the shedlock profile.
  • To enable the quartz profile, you can use the following command:
    mvn spring-boot:run -Dspring-boot.run.profiles=quartz

4. Build Native Image Locally

Do not forget to install and set the GRAALVM_HOME environment variable to the GraalVM installation directory.

  • To build a native image of the application, you can use the following command:
    mvn clean package -Pnative native:compile
  • To run the native image, you can use the following command:
    ./target/native-executable-app 
  • To run the native image with profile, you can use the following command:
    ./target/native-executable-app --spring.profiles.active=quartz

Getting Started with Docker

Do not forget to install Docker on your machine and make sure that the Docker daemon is running.

  1. Run docker-compose to build and run the application:

    This will take some time to build since this will be a multi-stage GraalVM native build.

    docker-compose -f docker-compose.yml -p quartz-shedlock-migration up -d
  2. You can also provide additional profile while running the docker-compose command:
    APP_ACTIVE_PROFILE=quartz docker-compose -f docker-compose.yml -p quartz-shedlock-migration up -d
  3. Check the logs to see if the application is running:
    docker-compose -f docker-compose.yml -p quartz-shedlock-migration logs -f
  4. To stop the application, you can use the following command:
    docker-compose -f docker-compose.yml -p quartz-shedlock-migration down

Contact

If you want to contact me you can reach me at;

About

Quartz Shedlock Migration Sample Project

License:Apache License 2.0


Languages

Language:Java 98.1%Language:Dockerfile 1.9%