Giter VIP home page Giter VIP logo

quartz-easy's Introduction

quartz-easy

Maven Central

Quartz Scheduler integration in Spring Boot Framework

The purpose of this project is to simplify the quartz scheduler integration in spring boot framework. I came up with this while setting up quartz scheduler in one of the projects at work.

How to use

  1. Annotate your Job implementation with Scheduled annotation with required configuration by setting suitable fields present in the annotation.
import com.indusnode.quartz.annotation.Scheduled;
...
@Scheduled(interval="5", intervalType=Scheduled.IntervalType.SEC)
class TestJob implements Job {
    //...
}
  1. set application property qe.base-package as your base package name of the project which will contain all your job implementations.
  2. And you are done! No need to define factories, JobDetail, Triggers...etc.

NOTE: This library currently doesn't provide database support for quarts data. You may setup those settings in traditional way besides this library.

Installation

Maven

In a Maven project, include the quartz-easy artifact in the dependencies section of your pom.xml

<dependency>
  <groupId>com.indusnode</groupId>
  <artifactId>quartz-easy</artifactId>
  <version>1.0.0</version>
</dependency>

Java Gradle

implementation 'com.indusnode:quartz-easy:1.0.0'

For other build systems please refer Maven Central Repository.

Download

If you do not use maven, gradle, ivy, or other build systems that consume maven-style binary artifacts, they can be downloaded directly via the Maven Central Repository.

Contribute

Lets make this more simpler and effective! Looking forward to PRs. ๐Ÿ˜„๐Ÿ‘

quartz-easy's People

Contributors

mejariamol avatar

Stargazers

 avatar

Watchers

 avatar

quartz-easy's Issues

can use Autowired in job class?

the code is not working

@ Scheduled(interval = "12", intervalType =  com.istrong.scheduler.annotation.Job.IntervalType.INTERVAL)
public class TestJob implements Job {

    private final Logger logger = LoggerFactory.getLogger(TestJob.class);

    @Autowired
    private  Diablo diablo;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        this.diablo.firenova();
        logger.info("asdfsdfd");
    }
}

exception:

org.quartz.SchedulerException: Job threw an unhandled exception.
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213) ~[quartz-2.3.1.jar:na]
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.1.jar:na]
Caused by: java.lang.NullPointerException: null
	at com.istrong.scheduler.TestJob.execute(TestJob.java:24) ~[classes/:na]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.3.1.jar:na]
	... 1 common frames omitted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.