bullmq | Message Queue and Batch processing | Runtime Evironment library
kandi X-RAY | bullmq Summary
kandi X-RAY | bullmq Summary
The fastest, most reliable, Redis-based distributed queue for Node. Carefully written for rock solid stability and atomicity.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bullmq
bullmq Key Features
bullmq Examples and Code Snippets
$ npm i @nestjs/microservices bullmq bull-mq-transport
import { Module } from '@nestjs/common';
import { BullMqModule } from 'bull-mq-transport';
@Module({
imports: [
BullMqModule.forRoot({
connection: { host: 'localhost', port: 6379 },
Community Discussions
Trending Discussions on bullmq
QUESTION
- I have an express app which uses bullmq queues, schedulers and workers. Even after pressing Ctrl + C I can still see the node process running inside my Activity manager but my server on the terminal shuts down. I know this because the bullmq task starts outputting console.log statements even after the server is down to the terminal.
This is what my server.js file looks like
...ANSWER
Answered 2022-Feb-18 at 08:11You have to call the close()
method on the workers:
QUESTION
I'm using MikroORM with BullMQ workers. When MikroORM is used with Express apps, it requires a RequestContext in order to maintain unique identity maps for each request. I suspect the same is required when processing multiple jobs with the same BullMQ worker.
Has anyone else successfully combined these two libraries? Is it possible to automatically fork the Entity Manager when a worker starts a new job?
...ANSWER
Answered 2021-Dec-03 at 13:54You can use @UseRequestContext()
decorator for such cases. It will basically act as if the method would be executed after a middleware that adds the context. Note that to use it, this.orm
needs to be the MikroORM
instance.
QUESTION
the code that I'm talking about is the repro code linked below
I have 2 "states" in the code (both of them are listening to queue global events):
- Add a single message
- Listen to messages
For some reason, Bull job is not reported as stalled when the listener worker is terminated only when the worker is back up.
although it should as stated in the docs:
...
ANSWER
Answered 2021-Oct-25 at 14:58I am afraid this works as designed, since in Bull the workers are also responsible of detecting stalled jobs, while in BullMQ you have the QueueScheduler that takes care of this.
QUESTION
I'm writing an HTTP API with expressjs in Node.js and here is what I'm trying to achieve:
- I have a regular task that I would like to run regularly, approx every minute. This task is implemented with an async function named
task
. - In reaction to a call in my API I would like to have that task called immediately as well
- Two executions of the
task
function must not be concurrent. Each execution should run to completion before another execution is started.
The code looks like this:
...ANSWER
Answered 2021-Oct-08 at 02:29Here's a version using RxJS#Subject that is almost working. How to finish it depends on your use-case.
QUESTION
I am using Heroku's Redis add-on. I upgraded yesterday to a higher tier and now I'm getting this when I send requests to my server. Any suggestions on what this error log means?
...ANSWER
Answered 2021-Apr-07 at 11:34Heroku shipped new updates related to Redis as outlined in their changelog here: https://devcenter.heroku.com/changelog-items/1952.
The New Redis addons without a version specified will now default to 6.0 version, as it is secured with the self-signed certificate because of its built-in TLS for production plans. You'll need to add ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE }
to handle the self-signed certificate. Please refer here for additional details: https://devcenter.heroku.com/articles/securing-heroku-redis
You may also work around this behavior by downgrading to Redis 5 version. You can do it by running(using --version flag): heroku addons:create heroku-redis:premium-2 --version 5 -a
. More details here: https://devcenter.heroku.com/articles/heroku-redis#version-support-and-legacy-infrastructure.
QUESTION
Let's say I have a function1.js
(or ts
, it doesn't matter in this case),function2.js
and any other files which are IIFE with different logic, like that:
ANSWER
Answered 2021-Feb-16 at 09:24I have found a relative example in BullMQ docs. Actually, it's called sandbox processors, and only Bull and BullMQ, among any others job queue managers support such feature.
Other, you'll need to write your own implementation.
The alternative is using pm2 programmatic API which would manage files manually. In that case, you pass a direct path to file with IIFE, and then it has been executed via pm2.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bullmq
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page