0

Jesque is a good tool I want to use.

Jesque is an implementation of Resque in Java. It is fully-interoperable with the Ruby and Node.js (Coffee-Resque) implementations.

Jesque is a Maven project and depends on Jedis to connect to Redis, Jackson to map to/from JSON and SLF4J for logging.

But before, I need some more informations. Is it also possible to retrieve all open jobs in Jesque? This info could be useful for my monitioring and for dirty restarts. After dirty shutdown it could be useful to check all remaining jobs with other distributed applications, if any other application has the same job already done or also in queue. Is this possible? I want to avoid, that the job is done twice or more, because there may be several applications behind loadbalancer and if the orginal client gets no OK or FAIL feedback, he tries again, so it is possible, that there are several identical jobs in several single applications (loadbalancer!!!).

I use Java so perhaps it is also possible to look into the REDIS DB myself with another redis db client tool. This would be my second option, if there is no chance to do this with jesque. Does anyone knows a good redis db client for Java?

heaphach
  • 1,492
  • 1
  • 20
  • 44

1 Answers1

0

I finally found the way it (should) work and I want do document it here. There is the interface 'QueueInfoDAO' implemented by QueueInfoDAORedisImpl.

this.jedisPool = new JedisPool(jesqueConfig.getHost());
this.queueInfoDAORedisImpl = new net.greghaines.jesque.meta.dao.impl.QueueInfoDAORedisImpl(jesqueConfig, jedisPool);
List<QueueInfo> queueInfos = queueInfoDAORedisImpl.getQueueInfos();

        for (QueueInfo queueInfo  : queueInfos) {
            //here are some QueueInfos like name or size
            for (Job queuedJob : queueInfo.getJobs()) {
                //read jobs arg,vars or do what you want
            }
        }

The only Problem is, that queueInfo.getJobs() return null. Does someone knows why? It seems that the DAO setJob() is never called, so this var stays null.

heaphach
  • 1,492
  • 1
  • 20
  • 44
  • There is another problem: It seems that all jobs stay in DB after running. Does anyone knows a way to delete them after running? – heaphach Sep 22 '15 at 08:33