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

docs(job): clarify per-queue scoping of Job Ids #2864

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/gitbook/guide/jobs/job-ids.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All jobs in BullMQ need to have a unique job id. This id is used to construct a

By default, job ids are generated automatically as an increasing counter, however it is also possible to specify a _custom id_.

{% hint style="info" %}
The uniqueness requirement is scoped by queue, i.e. you can have the same job id in different queues without any issues. The counter for automatically generated ids is also scoped by queue.
{% endhint %}

The main reason to be able to specify a custom id is in cases when you want to avoid duplicated jobs. Since ids must be unique, if you add a job with an existing id then that job will just be ignored and not added to the queue at all.

{% hint style="danger" %}
Expand Down
Loading