resolve IMPORTANT! Eviction policy is volatile-lru. It should be "noeviction" while using bullmq in node js

313 views Asked by At

I am getting this warning on my terminal while using bullmq on my node express ts project

resolve IMPORTANT! Eviction policy is volatile-lru. It should be "noeviction" while using bullmq in node js

this is the code currently in basic implementation

import { Queue, Worker } from 'bullmq';

const redisConnection = {
  host: '',
  port: ,
  password: '',
  username: '',
};
export const carQueue = new Queue('Cars', {
  connection: redisConnection,
});
export const worker = new Worker('Cars', async (job: any) => {
  console.log(job.data);
  return "done";
}, { connection: redisConnection });

I have tried chat gpt and bing ai but wasn't helpful, the docs on bullmq regarding this wasn't too clear

1

There are 1 answers

0
Tadeusz Niemiec On

It's about Redis eviction policy. Your instance uses the default configuration, which evicts old keys in case it runs out of memory. Bull warns you about this because this could potentially cause some messages to get lost. More information here: https://docs.redis.com/latest/rs/databases/memory-performance/eviction-policy/