-
Hi, and thanks for this amazing library! I'm using a POINT_TO_POINT queue and everything works great except for the fact that the number of Redis keys keeps growing, despite deliberately trying to not store messages. This is my setup const config: IRedisSMQConfig = {
redis: {
client: ERedisConfigClient.REDIS,
options: {
host: REDIS_HOST,
port: REDIS_PORT,
password: REDIS_PASS,
},
},
messages: {
store: {
acknowledged: false,
deadLettered: false,
},
},
};
Configuration.getSetConfig(config); And this is my message handler private async consume(msg: IMessageTransferable, done: ICallback<void>) {
const messages = msg.body as Message[];
try {
await this.processMessages(messages);
} catch (error) {
console.error("Error processing messages:", error);
}
done(null);
} Do I need to manually delete the messages after consumption? Here are the keys that Redis has
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This is exactly my issue as well. Messages in my queue are being produced and consumed without fail, but the 'global' keys keep growing as above. |
Beta Was this translation helpful? Give feedback.
-
I believe that the documentation was not clear enough about message storage. All published messages regardless of their statuses (scheduled, pending, acknowledged, dead-lettered, etc.) are stored in their respective queues until explicitly deleted. RedisSMQ provide dedicated classes to manage acknowledged and dead-lettered messages. To make use of these classes dedicated storage for these types of messages needs to be enabled. Please refer to https://github.com/weyoss/redis-smq/blob/master/packages/redis-smq/docs/message-storage.md for more details. |
Beta Was this translation helpful? Give feedback.
-
For anyone getting this far in the thread, here's what I did. I save both acknowledged and dead lettered messages, as per documentation. messages: {
store: {
acknowledged: true,
deadLettered: true,
},
}, The naive approachI used an interval to instantiate a The approach that workedI instantiated the same classes ( |
Beta Was this translation helpful? Give feedback.
I believe that the documentation was not clear enough about message storage.
All published messages regardless of their statuses (scheduled, pending, acknowledged, dead-lettered, etc.) are stored in their respective queues until explicitly deleted.
RedisSMQ provide dedicated classes to manage acknowledged and dead-lettered messages. To make use of these classes dedicated storage for these types of messages needs to be enabled.
Please refer to https://github.com/weyoss/redis-smq/blob/master/packages/redis-smq/docs/message-storage.md for more details.