RomainLanz / adonis-bull-queue

Queue system based on BullMQ for AdonisJS
MIT License
147 stars 26 forks source link

Support for redis-cluster #52

Open jjoek opened 3 months ago

jjoek commented 3 months ago

Hey I am using this with aws memory db and I get the following error

ReplyError: CROSSSLOT Keys in request don't hash to the same slot
    at parseError (/app/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/app/node_modules/redis-parser/lib/parser.js:302:14) {
  command: {
    name: 'evalsha',
    args: [
      '04bc84f52b5c1a1238af36a0c38c474721088663',
      '9',
      'bull:default:wait',
      'bull:default:active',
      'bull:default:priority',
      'bull:default:events',
      'bull:default:stalled',
      'bull:default:limiter',
      'bull:default:delayed',
      'bull:default:paused',
      'bull:default:meta',
      'bull:default:',
      '1722378879336',
      '',
      <Buffer de 00 03 a5 74 6f 6b 65 6e d9 26 61 34 61 65 39 32 37 61 2d 61 32 62 36 2d 34 34 36 39 2d 62 35 39 30 2d 37 38 65 37 34 37 32 64 65 38 64 33 3a 30 ac ... 24 more bytes>
    ]
  }
}

which after some bit of research I found out that the issue has something to do with redis cluster and from bullmq documentation:

bullmq docs on redis cluster

We are supposed to prefix our queues, I did this by adding the prefix option to the queue in my config to something as below:

const queueConfig: QueueConfig = {
  connection: {
    host: Env.get("QUEUE_REDIS_HOST"),
    port: Env.get("QUEUE_REDIS_PORT"),
    password: Env.get("QUEUE_REDIS_PASSWORD"),
  },

  queue: {
    prefix: "{queue-prefix}",
  },

When I run queue listen that is when I get the above error. Any ideas what could be wrong or what I need to update or change