Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Job_id #132

Closed
Giuffre opened this issue Jun 17, 2015 · 6 comments
Closed

Custom Job_id #132

Giuffre opened this issue Jun 17, 2015 · 6 comments

Comments

@Giuffre
Copy link

Giuffre commented Jun 17, 2015

is there a way to set a custom Job_id for a queue?

@manast
Copy link
Member

manast commented Jun 17, 2015

No, there is no way to do it, and it would'nt be recommended either since we want to guarantee unique ids for every job. Why do you need this functionality?

@albertjan
Copy link

Why not add an id to the job data, thats what we do. Bulls jobid is an integral part of a lot of functionality within bull and really shouldn't be part of your implementation, other than pointing to said job.

@Giuffre
Copy link
Author

Giuffre commented Jun 18, 2015

I implemented the pattern "message queue" in my application, specifically I have multiple instances listen on a channel Redis, each instance reads messages that pass in this channel and put them in a queue. Unfortunately I can not move the queue before these instances, so if I have n instances that are listening to the channel, i have n identical messages placed in the queue. If I could set a custom identifier, i could overwrite or check that the message has not been added to the queue.

@ryan-sandy
Copy link
Contributor

@Giuffre Are you pushing messages back onto the queue because your listener should not be handling that particular message? If so, you probably want to use a pub-sub model instead of a queue. Redis ships with this feature.

If that's not the case, could you differentiate between the "listeners" in your previous post? Are these "listeners" generating new jobs or receiving the output from the completed jobs?

@manast manast closed this as completed Jun 21, 2016
@campriceaustin
Copy link

I'd like to reopen this. We have a situation at Mixmax where we have a very high volume of jobs, and we need a concurrency-safe way of ensuring there's only ever one job of a certain type for each user at any given time.

If we could pass jobId as a job option, then override it at https:/OptimalBits/bull/blob/master/lib/scripts.js#L81, we could pass in the userId.

Happy to do a PR for this. Unless anyone has any advice to the contrary?

@campriceaustin
Copy link

As above, see #335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants