gresrun / jesque

An implementation of Resque in Java.
http://gresrun.github.io/jesque
Apache License 2.0
628 stars 131 forks source link

why does jesque not use namespace as prefix for recurring jobs? #158

Closed f9865 closed 5 years ago

f9865 commented 5 years ago

Hi, @argvk @gresrun I'm trying to understand how does jesque work by reading code. But I was wondering why doesn't JesqueUtils::createRecurringHashKey use namespace as prefix, when it creates redis key for recurring jobs. It seems like that jesque always use namespace as prefix to figure out jobs belong to different applications. https://github.com/gresrun/jesque/blob/master/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L98 If there are two different gRPC services use the same redis instance for jesque and they both have recurring jobs, will they take jobs from the same queue? Thanks

argvk commented 5 years ago

Hey @f9865.

But I was wondering why doesn't JesqueUtils::createRecurringHashKey use namespace as prefix, when it creates redis key for recurring jobs.

it does, you can see on these lines that hashKey is created from the queueKey itself.

If there are two different gRPC services use the same redis instance for jesque and they both have recurring jobs, will they take jobs from the same queue?

yes, you can have multiple services as consumers for the same recurring job.

Hope that helped!

f9865 commented 5 years ago

Appreciate your reply. This does help a lot.