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

refactor(job-queue-plugin): Use multiple BullMQ queues instead of one #3108

Open
wants to merge 6 commits into
base: minor
Choose a base branch
from

Conversation

dlhck
Copy link
Collaborator

@dlhck dlhck commented Oct 5, 2024

Description

Refactors the bullmq-job-queue-strategy to use a separate BullMQ queue for every Vendure job queue. This should improve the stability and issues with horizontally scaled worker instances. The current implementation pushes all jobs to a single BullMQ queue called vendure-job-queue, which is not best practice.

Resolves #2419 and #1726

Breaking changes

There is no breaking change.

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

Copy link

vercel bot commented Oct 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Oct 7, 2024 11:01am

@dlhck
Copy link
Collaborator Author

dlhck commented Oct 5, 2024

There is currently one major problem in the core implementation: Every job needs to have a unique ID. But with BullMQ the IDs are only unique within the sequence of a queue. This is the core issue that still needs to be resolved.

Edit: This has been solved by using a combination of the queue name and the BullMQ job ID as a unique ID

@dlhck
Copy link
Collaborator Author

dlhck commented Oct 6, 2024

@michaelbromley we are running into an issue, that it is not possible to display a list of all jobs from all queues in all states (aka the default list view). This is because of limitations of the BullMQ library and the way how the Redis keys are structured.

I see two options here:

  • Not support the default list view at all
  • Change the list view implementation to make it possible to disable the initial state (no filters) and automatically select the first queue (ergo only make it possible to view jobs filtered by queue)

@dlhck dlhck self-assigned this Oct 6, 2024
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

Successfully merging this pull request may close these issues.

1 participant