Skip to content

random retryDelay #126

Answered by weyoss
sylvainlap asked this question in Q&A
Discussion options

You must be logged in to vote

This is not a bug.

After a quick checkup, I came to the conclusion that issue you reported is actually a normal behavior and it is not a bug. Let me make it more clear to you.

Here the script I used for testing:

import { Consumer, Producer,  Message, QueueManager } from 'redis-smq';

Message.setDefaultConsumeOptions({
  ttl: 0,
  retryThreshold: 5,
  retryDelay: 2000,
});

const queue = `queue_${Date.now()}`;

const consume = () => {
  const consumer = new Consumer();
  consumer.consume(
    queue,
    (msg) => {
      console.log(`Received message ID ${msg.getId()} at ${Date.now()}`);
      throw new Error('Explicit error');
    },
    (err) => {
      if (err) console.log(err);
    },
  );

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by weyoss
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #94 on April 15, 2025 09:08.