Coder Social home page Coder Social logo

pjsb / redis-quartz Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redislabs/redis-quartz

0.0 2.0 0.0 41 KB

A Quartz Scheduler JobStore MAVEN "Fork" that uses Redis for persistent storage, that uses concurrent versions of third party libs

License: MIT License

Java 100.00%

redis-quartz's Introduction

RedisJobStore

A Quartz Scheduler JobStore that uses Redis for persistent storage.

Configuration

To get Quartz up and running quickly with RedisJobStore, use the following example to configure your quartz.properties file:

# setting the scheduler's misfire threshold, in milliseconds
org.quartz.jobStore.misfireThreshold: 60000

# setting the scheduler's JobStore to RedisJobStore
org.quartz.jobStore.class: com.redislabs.quartz.RedisJobStore

# setting your redis host
org.quartz.jobStore.host: <your_redis_host>

# setting your redis port
org.quartz.jobStore.port: <your_redis_port>

# setting your redis password (optional)
org.quartz.jobStore.password: <your_redis_password>

# setting a 'releaseTriggersInterval' will trigger a mechanism for releasing triggers of non-alive schedulers in a given interval, in milliseconds
org.quartz.jobStore.releaseTriggersInterval: 600000

# setting a 'instanceIdFilePath' will release triggers of previous schedulers on startup
org.quartz.jobStore.instanceIdFilePath: /etc/quartz

External Libraries

RedisJobStore uses the jedis, gson and jedis-lock libraries, so you'll have to download them and add them to your project's classpath or define the relevant Maven dependencies:

<dependency>
	<groupId>redis.clients</groupId>
	<artifactId>jedis</artifactId>
	<version>2.0.0</version>
</dependency>

<dependency>
 	<groupId>com.google.code.gson</groupId>
 	<artifactId>gson</artifactId>
 	<version>2.2.4</version>
</dependency>

<dependency>
  <groupId>com.github.jedis-lock</groupId>
  <artifactId>jedis-lock</artifactId>
  <version>1.0.0</version>
</dependency>

Limitations

RedisJobStore attempts to be fully compliant with all of Quartz's features, but currently has some limitations that you should be aware of:

  • Only SimpleTrigger and CronTriggerare supported.
  • For any GroupMatcher, only a StringOperatorName.EQUALS operator is supported. You should note that if your scheduler is designed to compare any group of jobs, triggers, etc. with a pattern-based matcher.
  • RedisJobStore is designed to use multiple schedulers, but it is not making any use of the org.quartz.scheduler.instanceName. The only limitation here is that you should maintain the uniquness of your trigger_group_name:trigger_name, and your job_group_name:job_name and you'll be good to go with multiple schedulers.
  • A Scheduler should be started once on a machine, also to ensure releasing locked triggers of previously crashed schedulers.
  • Data atomicity- RedisJobStore is not using any transaction-like mechanism, but ensures synchronization with global lockings. As a result, if a connection issue occurs during an operation, it might be partially completed.
  • JobDataMap values are stored and returned as Strings, so you should implement your jobs accordingly.
  • RedisJobStore is firing triggers only by their fire time, without any cosideration to their priorities at all.

Known Issues

  1. Quartz's standard JobStores are sometimes considering triggers without a next fire time as tirggers in a WAITING state. As RedisJobStore is using redis Sorted Sets to maintain triggers states, using their next fire time as the score, it will consider these triggers as stateless.

Redis Schema

To better understand the workflow and the behavior of a Quartz Scheduler using a RedisJobStore, you may want to review the redis schema in which the RedisJobStore is making a use of at: /schema/schema.txt

License

The MIT License

githalytics.com alpha

redis-quartz's People

Contributors

kehati avatar

Watchers

James Cloos avatar Jens Peters avatar

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.