Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BullMQ reusing redis connections

I am trying to add logic to re-use redis connections with bullMQ using this section of the bullMQ docs.

I am using the most recent (1.80.6) BullMQ npm version.

From the docs, the expectation is to define the createClient method, which is a property of QueueOptions.

However, doing so raises an error TS2559.

Type '{ createClient: (type: string, redisOpts: any); }' has no properties in common with type 'QueueOptions'.

Was the createClient logic deprecated?if Yes, are there alternatives?

If not, any pointers to what am doing wrong?

like image 721
vitalis shisoka Avatar asked Nov 28 '25 02:11

vitalis shisoka


1 Answers

You can pass an IORedis instance in as the connection.

import IORedis from 'ioredis';
const connection = new IORedis('redis://someredisurl:6379');
const myQueue = new Queue('queue_name', { connection });
like image 101
Luke Belbina Avatar answered Nov 29 '25 20:11

Luke Belbina



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!