Skip to content

Get started with Quartz scheduler in Spring Boot using a single annotation

License

Notifications You must be signed in to change notification settings

AminBhst/quartz-auto-config-boot

Repository files navigation

license release

Usage Guide

Annotate your SpringBootApplication Class with @EnableQuartzConfiguration

@SpringBootApplication
@EnableQuartzConfiguration
public class TestApplication {

    public static void main(String[] args) {
        SpringApplication.run(TestApplication.class, args);
    }
}

Annotate your job classes with @QuartzJob and provide either the cron or the repeatInterval property

@QuartzJob(cron = "0 0/1 * * * ?")
public class TestJob implements Job {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        System.out.println("Running Job every minute");
    }
}

Get Quartz Auto Config Boot

You can add Quartz AutoConfig to your project as a maven dependency

It is distributed through Maven Central

Apache Maven

<dependency>
    <groupId>io.github.aminbhst</groupId>
    <artifactId>quartz-auto-config-boot</artifactId>
    <version>1.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle

dependencies {
    compileOnly 'io.github.aminbhst:quartz-auto-config-boot:1.0.0'
    annotationProcessor 'io.github.aminbhst:quartz-auto-config-boot:1.0.0'
}

About

Get started with Quartz scheduler in Spring Boot using a single annotation

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages