Git Product home page Git Product logo

quartz-redis-jobstore's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quartz-redis-jobstore's Issues

How to solve redis bigkey problem?

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?

When can we expect a new release?

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)

scheduledFireTime is not set correctly when trigger fires

            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.

Unable to deserialize calendar json for calendar

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.

When scheduling a single execution job, fails to execute

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?

Auth fails under cluster mode

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)

ERR This instance has cluster support disabled

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)

###### quartz, properties file

org.quartz.jobStore.class = net.joelinn.quartz.jobstore.RedisJobStore
org.quartz.jobStore.host = localhost

org.quartz.jobStore.port =

org.quartz.jobStore.redisCluster = true

org.quartz.jobStore.redisSentinel =

org.quartz.jobStore.masterGroupName =

org.quartz.jobStore.database:

org.quartz.jobStore.keyPrefix = a_prefix_
org.quartz.jobStore.lockTimeout = 30000
org.quartz.threadPool.threadCount = 3

########### Example1 Class

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();

}

}

############## Job Class

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.

Task will never fire again if I reboot my program.

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:

image

  1. The QuartzSchedulerThread will get triggers with waiting state and convert its waiting state to acquired state.(delete it and then add it)

image

  1. And in the below, the 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?

How to use TriggerListner?

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!

Redis 3 Clustering Support?

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!

NPE in ApplyMisfire

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);

    }
}

Suppress error log on ObjectAlreadyExistsException

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.

Releasing Triggers

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:

  1. Trigger1 to fire in 20s, Trigger1 acquired.
  2. Trigger2 to fire in 10s, Trigger2 acquired.
  3. Trigger2 fired.
  4. x time later (after the defined Trigger1 fire time), Trigger1 is acquired as a MisFire.

Thanks

jobs not getting fired at correct intervals defined in the triggers

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

No mechanism to release abandoned blocked jobs

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?

@DisallowConcurrentExecution seems not working with redis cluster

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.
bildschirmfoto 2017-01-09 um 16 34 23

Is some extra config needed? I will attach my sample.

thanks for help.
regards
Dmitri

Triggers that do no lock that cause all invoke.

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.

Error while setting up quartz.properties

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

jedis 2.9.0, redis.clients.jedis.exceptions.JedisDataException: ERR This instance has cluster support disabled

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.

screen shot 2017-03-15 at 11 32 18

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

Need help with firing triggers

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

SimpleTrigger scheduled to execute once is firing indefinite number of times

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

Trigger wont be removed if JobConcurrentExecutionDisallowed is true and no nextFireTime set (Version 1.1.9)

Given the following scenario:

  • Job with isJobConcurrentExecutionDisallowed(job.getJobClass()) == true
  • trigger.getNextFireTime() == null

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.

不支持集群

1.1.15版本

2个服务启动 会同时执行任务 锁有问题

Support SSL Redis connections

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.

ERR This instance has cluster support disabled

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.

JobDataMap Doesnot persist when associated with triggers

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.

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.