taskforcesh / bullmq

BullMQ - Message Queue and Batch processing for NodeJS and Python based on Redis
https://bullmq.io
MIT License
5.94k stars 384 forks source link

Redis connection reusability confusion #169

Open pavelserbajlo opened 4 years ago

pavelserbajlo commented 4 years ago

Ok, so I have 3 options on how to set up bullmq with redis:

  1. I set connection where I can also pass host/port myself
  2. I set connection where I can pass dummy redis instance with my connection params
  3. I set client with dummy redis instance I have to take care of myself

with 1) I understand I get no reusability in this scenario with 2) bullmq fails to start with my 12 different queues, queueSchedulers and workers, total of 36 instances needing redis connection (I know, large app). It just hangs on waitUntilReady() of 8th instance. with 3) all seems to work, but given all the options here I'm not sure if this is what I should be using

Can anyone chime in on this? Thanks!

manast commented 4 years ago

What do you mean with "dummy" redis instance? The idea of reusing connections is to instantiate a valid working redis instance and then use that same one in all the bullmq instances, is not that what you are doing?