3

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?

1 Answers1

1

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 });
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
  • will this then use the connection passed in or create a new connection from it. by reading the documentation i thought it was going to create new connection from it. https://docs.bullmq.io/guide/connections – user566245 Jun 11 '23 at 16:10