Skip to content

JobStore using redis(key-value storage and distributed lock)

License

Notifications You must be signed in to change notification settings

attemper/quartz-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quartz-redis

A JobStore of Quartz Scheduler using Redis that supports data storage and distributed lock. 中文

Used by

👉 Attemper: A distributed,multi-tenancy,job-flow scheduling application 👈

Github
Gitee

Features

  • Support redis's distributed lock
  • Support redis's cluster and sentinel mode

Configurations

  • Add dependency to pom.xml
<dependency>
	<groupId>com.github.attemper</groupId>
	<artifactId>quartz-redis</artifactId>
	<version>0.9.3</version>
</dependency>
  • Config org.quartz.jobStore.xxx To use quartz-redis,you can config like the following properties in quartz.properties. If you want to use it in spring-boot apps, it's the same configurations in .yml or .properties
# job store class
org.quartz.jobStore.class = com.github.quartz.impl.redisjobstore.RedisJobStore

# redis host (optional)
org.quartz.jobStore.host = <default is localhost>

# redis password (optional)
org.quartz.jobStore.password = <default is null>

# redis port (optional)
org.quartz.jobStore.port = <default is 6379>

# redis database (optional)
org.quartz.jobStore.database = <default is 0>

# see https://lettuce.io/core/release/reference/index.html#redisuri.uri-syntax
org.quartz.jobStore.uri = <you can use it replace host/password/port/database,like redis://localhost>

# redis cluster mode
org.quartz.jobStore.clusterNodes = <using comma-delimited list uri>

# redis sentinel mode
org.quartz.jobStore.sentinelNodes = <using comma-delimited list uri>

# redis sentinel matser name
org.quartz.jobStore.sentinelMaster = <master node name>

# enable ssl or not (optional)
org.quartz.jobStore.ssl = <default is false>
  • you should config one of
    • host,password,port and database
    • uri
    • clusterNodes
    • sentinelNodes and sentinelMaster

Dependencies

quartz-redis depends on the flowing project

<dependency>
	<groupId>com.github.attemper</groupId>
	<artifactId>quartz-core</artifactId>
	<version>2.3.2.2</version>
</dependency>
<dependency>
	<groupId>io.lettuce</groupId>
	<artifactId>lettuce-core</artifactId>
	<version>5.x</version>
</dependency>
<dependency>
	<groupId>com.fasterxml.jackson.core</groupId>
	<artifactId>jackson-databind</artifactId>
	<version>2.x</version>
</dependency>

About

JobStore using redis(key-value storage and distributed lock)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages