jlinn / quartz-redis-jobstore Goto Github PK
View Code? Open in Web Editor NEWA Quartz Scheduler JobStore using Redis.
License: Apache License 2.0
A Quartz Scheduler JobStore using Redis.
License: Apache License 2.0
Please add support for Spring Boot type configuration (so that usage of quartz.properties fiel can be dropped).
I need to do something in misfire of triggers,
but they doesn't fired "fireComplete" either "misFired".
I use them in RAMJobStore was right.
pls help me whether TriggerListener is SUPPORT!
Jedis 2.9.0 now supports SSL. Default for Azure Redis is to not enable nonSSL connections. Would be nice to have SSL connection support.
Hi I am Getting This issue.
Caused by: java.lang.NullPointerException
at net.joelinn.quartz.jobstore.AbstractRedisStorage.applyMisfire(AbstractRedisStorage.java:565)
at net.joelinn.quartz.jobstore.AbstractRedisStorage.acquireNextTriggers(AbstractRedisStorage.java:819)
at net.joelinn.quartz.jobstore.RedisJobStore$39.doWithLock(RedisJobStore.java:1041)
at net.joelinn.quartz.jobstore.RedisJobStore$39.doWithLock(RedisJobStore.java:1037)
at net.joelinn.quartz.jobstore.RedisJobStore.doWithLock(RedisJobStore.java:1154)
... 2 more
Code that I am Executing
public class TestQuartzWithRedis {
public static void main (String[] args) throws SchedulerException, InterruptedException {
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
scheduler.start();
Date startTime = DateBuilder.futureDate(5000, DateBuilder.IntervalUnit.MILLISECOND);
JobDetail job = JobBuilder
.newJob(SampleJob.class)
.withIdentity(UUID.randomUUID().toString(), "messageGroup")
.requestRecovery()
.build();
SimpleTrigger trigger = (SimpleTrigger) newTrigger()
.forJob(job)
.withIdentity("trigger:" + UUID.randomUUID().toString(), "messageGroup")
.startAt(startTime)
.build();
scheduler.scheduleJob(job, trigger);
}
}
HI
I have 2 jobs with separate triggers,
trigger : group1.triggerA For Job key refreshgroup1.refreshjobA will run at: Tue Oct 18 15:23:12 IST 2016 and repeat: 10 times, every 10 seconds
trigger : group2.triggerB For Job key refreshgroup1.refreshjobB will run at: Tue Oct 18 15:23:14 IST 2016 and repeat: 10 times, every 7 seconds
But in the output i see that Job A doesnot repeat after 10 sec, Sometime the interval is 20 sec, sometimes it is 14 sec
Same problem for Job B. the interval is not 7 sec as it is configured to be. What am i missing here?
Thanks for your help.
------- Starting Scheduler ----------------
------- Started Scheduler -----------------
------- Waiting 90 seconds... -------------
RefreshJob: execute called Tue Oct 18 15:23:19 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:23:26 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:23:32 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:23:39 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:23:45 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:23:52 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:23:59 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:24:06 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:24:14 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:24:21 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:24:28 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:24:35 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:24:42 IST 2016 : for A
Is this project still maintained or not? If not what is the recommended way to integrate redis with quartz?
We use redis as a trigger storage on the production environment. Now we have a problem. The number of triggers reaches tens of millions. There are several large collections in redis. Each collection element has thousands of elements, resulting in The memory usage of a single redis machine is too high. Is there a way to help us solve this problem?
Hi,
I installed redis helm-chart. the only changes that were made to the values are:
redis:
fullnameOverride: "redis"
redisPort: 6379
usePassword: false
when i am running the command:
kubectl exec -it redis-master-0 -- redis-cli cluster info
I got an error: ERR This instance has cluster support disabled
according to the docs, redis-cluster is enabled by default.
I just tested this jobstore connecting to a Redis 3.x cluster and it doesn't work. I get a series of redis.clients.jedis.exceptions.JedisMovedDataException: MOVED 13673 {new-hosts-ip}:{port}
exceptions, which I believe is Redis's way to communicate back to the driver that the data it's looking for is found on another master.
In looking at the source, a JedisPool
is used and you'd need to use a JedisCluster
instance instead to support clustering. Do you have any plans to add support for this?
Also it'd actually be really nice if there were a way I could supply my on instance of JedisCluster
, instead of maintaining duplicate configuration, as I already use Jedis in our system and I'd really like to avoid a second connection pool to Redis.
Thanks!
jedis 2.9.0,
connecting to a Redis labs enterprise free trial 4 process / shard cluster
redis pack: redis-4.4.2
redis.clients.jedis.exceptions.JedisDataException: ERR This instance has cluster support disabled
redis.clients.jedis.exceptions.JedisDataException: ERR This instance has cluster support disabled
at redis.clients.jedis.Protocol.processError(Protocol.java:127)
at redis.clients.jedis.Protocol.process(Protocol.java:161)
at redis.clients.jedis.Protocol.read(Protocol.java:215)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)
at redis.clients.jedis.Connection.getRawObjectMultiBulkReply(Connection.java:285)
at redis.clients.jedis.Connection.getObjectMultiBulkReply(Connection.java:291)
at redis.clients.jedis.Jedis.clusterSlots(Jedis.java:3376)
at redis.clients.jedis.JedisClusterInfoCache.discoverClusterNodesAndSlots(JedisClusterInfoCache.java:54)
at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:39)
at redis.clients.jedis.JedisClusterConnectionHandler.<init>(JedisClusterConnectionHandler.java:17)
at redis.clients.jedis.JedisSlotBasedConnectionHandler.<init>(JedisSlotBasedConnectionHandler.java:20)
at redis.clients.jedis.JedisSlotBasedConnectionHandler.<init>(JedisSlotBasedConnectionHandler.java:15)
at redis.clients.jedis.BinaryJedisCluster.<init>(BinaryJedisCluster.java:41)
at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:83)
at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:74)
I have created a 4 shard cluster running on 1 physical box, using the Redis web console.
the redis console says its a cluster ?
when using open source redis 3.2.8, and using the redis.conf file, every thing works as expected.
port 6379
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly no
I have read this related issue,
#10
Hi @jlinn
I am getting this exception when i set the redisCluster property to true:
Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: ERR This instance has cluster support disabled
at redis.clients.jedis.Protocol.processError(Protocol.java:117)
at redis.clients.jedis.Protocol.process(Protocol.java:151)
at redis.clients.jedis.Protocol.read(Protocol.java:205)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
at redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:216)
at redis.clients.jedis.Connection.getBulkReply(Connection.java:205)
at redis.clients.jedis.Jedis.clusterNodes(Jedis.java:3166)
at redis.clients.jedis.JedisClusterInfoCache.discoverClusterNodesAndSlots(JedisClusterInfoCache.java:48)
at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:36)
at redis.clients.jedis.JedisClusterConnectionHandler.(JedisClusterConnectionHandler.java:25)
at redis.clients.jedis.JedisSlotBasedConnectionHandler.(JedisSlotBasedConnectionHandler.java:21)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:53)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:48)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:35)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:27)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:31)
at net.joelinn.quartz.jobstore.RedisJobStore.initialize(RedisJobStore.java:116)
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1321)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1525)
at com.quartzsamples.fromdoc.schedulers.Example1.main(Example1.java:29)
org.quartz.jobStore.class = net.joelinn.quartz.jobstore.RedisJobStore
org.quartz.jobStore.host = localhost
org.quartz.jobStore.redisCluster = true
org.quartz.jobStore.keyPrefix = a_prefix_
org.quartz.jobStore.lockTimeout = 30000
org.quartz.threadPool.threadCount = 3
package com.quartzsamples.fromdoc.schedulers;
import static org.quartz.JobBuilder.newJob;
import static org.quartz.TriggerBuilder.newTrigger;
import java.util.Date;
import org.quartz.DateBuilder;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.Trigger;
import org.quartz.impl.StdSchedulerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.quartzsamples.fromdoc.jobs.HelloJob;
public class Example1 {
public static void main(String[] args) throws SchedulerException {
Logger log = LoggerFactory.getLogger(Example1.class);
Date mydate = DateBuilder.evenHourDate(new Date());
JobDetail job = newJob(HelloJob.class).withIdentity("myJob").build();
Trigger trig = newTrigger().withIdentity("mytrigger").startAt(mydate).build();
SchedulerFactory sf = new StdSchedulerFactory(
"com/quartzsamples/fromdoc/properties/quartz.properties");
Scheduler sched = sf.getScheduler();
sched.scheduleJob(job, trig);
sched.start();
}
}
package com.quartzsamples.fromdoc.jobs;
import java.util.Date;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class HelloJob implements Job{
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
System.out.println("From HelloJob Class "+new Date());
System.out.println(arg0.getFireInstanceId());
}
}
Please help me with this.
Hello,
i'm testing redis job store with redis cluster. It seems that DisallowConcurrentExecution does not work. With local redis installation works correctly.
I have a Repeat Interval of 60 sec. The Job takes 70 sec to execute.
It is the only one job configured. The next job ist started during the last one still running.
Is some extra config needed? I will attach my sample.
thanks for help.
regards
Dmitri
HI, I am using redisStore for Quartz.
I see that if I pass data using JobDetail.JobDataMap.put("key","value") I can access it when my job fires doing context.getJobDetail().getJObDataMap()
But if i try to pass JobDataMap via the trigger that i used to trigger the job, trigger1.getJobDataMap().put("key","value"), then i cannot access the value when my job fires bu doing context.getTrigger().getJobDataMap().getString("key");
the above works if i use RAMStore instead of RedisStore.
Please help resolve this issue. it is urgent.
Please let me know if i am missing something here.
Thanks.
Password is not unused when creating JedisCluster instance.
Pls see: RedisJobStore.java line 129
Set<HostAndPort> nodes = buildNodesSetFromHost();
jedisCluster = new JedisCluster(nodes);
storage = new RedisClusterStorage(redisSchema, mapper, signaler, instanceId, lockTimeout);
Related config in quartz.properties:
# set the scheduler's JobStore class (required)
org.quartz.jobStore.class = net.joelinn.quartz.jobstore.RedisJobStore
# set the Redis host (required)
# <your redis host or a comma-delimited list of host:port if clustered use is desired>
org.quartz.jobStore.host = localhost:6379,localhost:6379
# set the scheduler's trigger misfire threshold in milliseconds (optional, defaults to 60000)
org.quartz.jobStore.misfireThreshold = 60000
# set the redis password (optional, defaults null)
org.quartz.jobStore.password = 123456
# set the redis port (optional, defaults to 6379)
org.quartz.jobStore.port = 6379
# enable Redis clustering (optional, defaults to false)
org.quartz.jobStore.redisCluster = true
# enable Redis sentinel (optional, defaults to false)
#org.quartz.jobStore.redisSentinel = <true or false>
# set the sentinel master group name (required if redisSentinel = true)
#org.quartz.jobStore.masterGroupName = <your master group name>
# set the redis database (optional, defaults to 0)
org.quartz.jobStore.database: 0
# set the Redis key prefix for all JobStore Redis keys (optional, defaults to none)
org.quartz.jobStore.keyPrefix = purchase/quartz/
# set the Redis lock timeout in milliseconds (optional, defaults to 30000)
org.quartz.jobStore.lockTimeout = 30000
log info:
Caused by: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
at redis.clients.jedis.Protocol.processError(Protocol.java:127)
at redis.clients.jedis.Protocol.process(Protocol.java:161)
at redis.clients.jedis.Protocol.read(Protocol.java:215)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)
at redis.clients.jedis.Connection.getRawObjectMultiBulkReply(Connection.java:285)
at redis.clients.jedis.Connection.getObjectMultiBulkReply(Connection.java:291)
at redis.clients.jedis.Jedis.clusterSlots(Jedis.java:3376)
at redis.clients.jedis.JedisClusterInfoCache.discoverClusterNodesAndSlots(JedisClusterInfoCache.java:54)
at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:39)
at redis.clients.jedis.JedisClusterConnectionHandler.<init>(JedisClusterConnectionHandler.java:17)
at redis.clients.jedis.JedisSlotBasedConnectionHandler.<init>(JedisSlotBasedConnectionHandler.java:20)
at redis.clients.jedis.JedisSlotBasedConnectionHandler.<init>(JedisSlotBasedConnectionHandler.java:15)
at redis.clients.jedis.BinaryJedisCluster.<init>(BinaryJedisCluster.java:41)
at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:83)
at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:70)
at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:66)
at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:62)
at net.joelinn.quartz.jobstore.RedisJobStore.initialize(RedisJobStore.java:129)
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1333)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1519)
at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:597)
at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
Actually I can but it is not used by RedisJobStore.initialize
I can't belive that there is no password property for this..
Hi
I am trying to use this project to store some reminders in redis server. I am able to create the jobs and see them in redis, but the trigger I am creating is not being fired. Could you please help me with a sample, if possible?
Here is my code to initialize JobStore:
RedisJobStore jobStore = new RedisJobStore();
jobStore.setHost("localhost");
jobStore.setPort(6379);
jobStore.setThreadPoolSize(10);
try {
jobStore.initialize(null, null);
JobDetail job = JobBuilder.newJob(MyTestJob.class).withIdentity("my4_test_job").storeDurably(true).usingJobData("first_name", "Saurab").usingJobData("age", 23).usingJobData("last_name", "Nayak").build();
CronTrigger trigger = TriggerBuilder.newTrigger().forJob(job).withSchedule(CronScheduleBuilder.dailyAtHourAndMinute(22, 18).inTimeZone(TimeZone.getTimeZone("IST")).withMisfireHandlingInstructionFireAndProceed()).withIdentity("my_test_job_trigger4").withDescription("sample trigger").build();
jobStore.storeJobAndTrigger(job, (OperableTrigger) trigger);
System.out.println();
} catch (ObjectAlreadyExistsException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JobPersistenceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SchedulerConfigException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Here is my Job Class:
public class MyTestJob implements Job {
private static String KEY_FIRST_NAME = "first_name";
private static String KEY_LAST_NAME = "last_name";
private static String KEY_AGE = "age";
@Override
public void execute(JobExecutionContext context)
throws JobExecutionException {
System.out.println(context.getJobDetail().getJobDataMap().getString(KEY_FIRST_NAME));
}
}
I am not seeing the execute method being called. Please let me know if I have missed something here.
Thanks
I have created a calendar:
HolidayCalendar holidayCalendar = new HolidayCalendar();
holidayCalendar.addExcludedDate(new DateTime().withDayOfMonth(28).toDate());
scheduler.addCalendar("myCalendar", holidayCalendar, false, false);
when I try retrieving the calendar:
scheduler.getCalendar("myCalendar");
it throws the error:
ERROR net.joelinn.quartz.jobstore.AbstractRedisStorage - Unable to deserialize calendar json for myCalendar
This only happens when using redis as the JobStore. If I disable redis and use RAM instead, it works fine.
Any help on this?
Thanks.
TriggerFiredBundle triggerFiredBundle = new TriggerFiredBundle(job, trigger, calendar, false, new Date(), previousFireTime, previousFireTime, trigger.getNextFireTime());
sets scheduledFireTime
not to the "real" scheduled time when misfires are processed.
This plays a role when the misfire policy is set to MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
Fix: Change to
TriggerFiredBundle triggerFiredBundle = new TriggerFiredBundle(job, trigger, calendar, false, new Date(), trigger.getPreviousFireTime(), previousFireTime, trigger.getNextFireTime());
like the other job stores do.
Came across the issue when upgrading from 1.1.5 to 1.1.7.
I scheduled single execution jobs, and had no issues with execution with 1.1.5.
After the update, I am now getting exceptions:
org.quartz.JobPersistenceException: Could not set triggers as fired.
at net.joelinn.quartz.jobstore.RedisJobStore.doWithLock(RedisJobStore.java:1128) ~[quartz-redis-jobstore-1.1.7.jar:?]
at net.joelinn.quartz.jobstore.RedisJobStore.triggersFired(RedisJobStore.java:1051) ~[quartz-redis-jobstore-1.1.7.jar:?]
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:336) [quartz-2.2.3.jar:?]
Caused by: java.lang.NullPointerException
at net.joelinn.quartz.jobstore.RedisStorage.triggersFired(RedisStorage.java:694) ~[quartz-redis-jobstore-1.1.7.jar:?]
at net.joelinn.quartz.jobstore.RedisStorage.triggersFired(RedisStorage.java:26) ~[quartz-redis-jobstore-1.1.7.jar:?]
at net.joelinn.quartz.jobstore.RedisJobStore$41.doWithLock(RedisJobStore.java:1055) ~[quartz-redis-jobstore-1.1.7.jar:?]
at net.joelinn.quartz.jobstore.RedisJobStore$41.doWithLock(RedisJobStore.java:1051) ~[quartz-redis-jobstore-1.1.7.jar:?]
at net.joelinn.quartz.jobstore.RedisJobStore.doWithLock(RedisJobStore.java:1121) ~[quartz-redis-jobstore-1.1.7.jar:?]
... 2 more
Looks to be related to this change (RedisStorage:694):
final long nextFireTime = trigger.getNextFireTime().getTime();
jedis.hset(triggerHashKey, TRIGGER_NEXT_FIRE_TIME, Long.toString(nextFireTime));
setTriggerState(RedisTriggerState.WAITING, (double) nextFireTime, triggerHashKey, jedis);
Would it be the case that since its a single execution, that its failing to find a next execute?
1.1.15版本
2个服务启动 会同时执行任务 锁有问题
My quartz-schedule's triggers is waiting_triggers, how shoud I do? tks
SimpleTrigger uses the timesTriggered property for cancelling the next fire time if it has surpassed the specified repeat count. However, this field is not being updated in the Redis storage, and this causes the nextFireTime not to be set properly and causes a misfire instruction to take place, causing the job to reschedule.
Hi,
If my task shecduler servers are distributed(cluster mode),does this project support good?
thanks
Can you please update the jar in https://mvnrepository.com/artifact/net.joelinn/quartz-redis-jobstore/1.1.15
with new jedis version
Task will never fire again if I reboot my program. I follow the code of RedisJobStore
and find that the trigger has 2 states, which are waiting
and acquired
(the redis key is prefix_acquired_triggers
and prefix_waiting_triggers
). If the task state was acquired
when I shutdown my program, then QuartzSchedulerThread
couldn't get the waiting triggers and couldn't fire the task.
The code of QuartzSchedulerThread
is the following:
QuartzSchedulerThread
will get triggers with waiting state and convert its waiting state to acquired state.(delete it and then add it)QuartzSchedulerThread
fires the task and then converts its acquired state to a waiting state.QuartzSchedulerThread
will repeat the action over and over again.
However:
When I reboot my program and the state of task is acquired, and then the first step can't get the task so that the task will never be fired again.
PS: I found the task will be fired again after my program starts 5-10 minutes(The cron of my task is 0/5 * * * * ?
).
Why can't the task recover right away when my program starts? And what should I do?
Hi,
Just a question, was there a reason why a previously acquired trigger is not release, when a newer trigger is acquired?
Noticing the following case:
Thanks
We are scheduling job using simple trigger which is meant to be fired only once in a fixed datetime in future. We are using RedisJobStore to schedule jobs in a clustered mode. Trigger is executing job at scheduled time but after that job is misfiring indefinite number of times. Following are stats of trigger
where startFireTime is set to the time at which job was scheduled to execute.
{
"startFireTime": "Sun Jun 09 15:10:00 IST 2019",
"nextFireTime": "Sun Jun 09 15:11:39 IST 2019",
"previousFireTime": "Sun Jun 09 15:13:50 IST 2019",
"finalFireTime": "Sun Jun 09 15:10:00 IST 2019",
"endFireTime": null
}
here suprisingly nextFireTime is less than previousFireTime. nextFireTime should be set to null after the single execution of job
3.0.1 is out: https://repo1.maven.org/maven2/redis/clients/jedis/
Hi,
your lib seems very similar to https://github.com/RedisLabs/redis-quartz : what are the key differences/advandages between the two losutions ?
thanks
Hi,I run the web application on two tomcats base with the same redis config.
But the trigger of them all invoke separately,they seem do not have a lock at redis.
Before that,I rewrite some code that suit my system environment.I don't know if it will make problems.
I will upload my code later.
Hi,I run the web application on two tomcats base with the same redis config.
But when I shut down one tomcat which run the job,the another doesn't resume the job.
What's wrong with it?
Hello,
it appears that @DisallowConcurrentExecution
is not working. Can this be due to the storage backend or should I look for some other problem with my setup?
I want to get a new release of quartz-redis-jobstore
because it is blocking me to upgrade to the latest spring-boot (which uses jedis 3.0.1)
Given the following scenario:
In this case in RedisStorage.triggersFired the else case in line 744 ( jedis.hset(triggerHashKey, TRIGGER_NEXT_FIRE_TIME, "")) is not executed, as there is an else if else from "if (isJobConcurrentExecutionDisallowed(job.getJobClass()))", therefor the trigger wont be removed in RedisStorage.triggeredJobComplete line 818 (if(isNullOrEmpty(jedis.hget(triggerHashKey, TRIGGER_NEXT_FIRE_TIME)))) as the expression evaluates to false.
This leads to jobs running and running again even though the shall be deleted.
If someone has used this library please help in setting up.
I am using spring boot and quartz and want to set redis as jobstore.
However, the build always fails.
Is there any other setup required except configuring the quartz.properties
It doesn't seem like there is any mechanism to release blocked jobs that have been abandoned by a scheduler.
I see that there is AbstractRedisStorage#releaseTriggersCron()
, but it will only execute if the scheduler has stopped running jobs altogether. The scenario I'm thinking of is if a scheduler has some jobs locked, is then killed (or dies uncleanly), and is brought back up. In this case, the lastTriggersReleaseTime
will be up-to-date, and any jobs that are blocked
will remain so.
Is this an issue you see as worth addressing, or is there something I'm missing that would pick these up?
After invoke scheduler.rescheduleJob(xx,xx),all triggers are failed to synchronize under two machines.
When schedule some job, I want to catch the ObjectAlreadyExistsException
to determine whether exists a same job and then reschedule it. This works fine but the log output from RedisStorage
is annoying. Like this:
2019-05-22 16:42:47.475 INFO 9064 --- [ main] n.joelinn.quartz.jobstore.RedisJobStore : Job and / or trigger already exist in storage.
org.quartz.ObjectAlreadyExistsException: Unable to store Job : 'com.handarui.novel.server.biz.task.IndexUpdateNovelJob.indexUpdateNovel', because one already exists with this identification.
at net.joelinn.quartz.jobstore.RedisStorage.storeJob(RedisStorage.java:167)
at net.joelinn.quartz.jobstore.RedisStorage.storeJob(RedisStorage.java:26)
at net.joelinn.quartz.jobstore.RedisJobStore$1.doWithLock(RedisJobStore.java:263)
at net.joelinn.quartz.jobstore.RedisJobStore$1.doWithLock(RedisJobStore.java:260)
at net.joelinn.quartz.jobstore.RedisJobStore.doWithLock(RedisJobStore.java:1154)
at net.joelinn.quartz.jobstore.RedisJobStore.doWithLock(RedisJobStore.java:1136)
at net.joelinn.quartz.jobstore.RedisJobStore.storeJobAndTrigger(RedisJobStore.java:260)
at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:886)
at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:249)
at com.handarui.novel.server.biz.task.QuartzStartRunner.startIndexUpdateNovelJob(QuartzStartRunner.kt:132)
at com.handarui.novel.server.biz.task.QuartzStartRunner.run(QuartzStartRunner.kt:29)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:732)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:716)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:703)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:304)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.handarui.novel.server.Main.main(Main.java:22)
I wunder if it can be suppressed and just let user to handle the exception.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.