gdaws/stompit

Setting AMQ_SCHEDULED_DELAY doesn't work

Opened this issue · 0 comments

I'm setting AMQ_SCHEDULED_DELAY in the send headers, setting it to 10 seconds, and schedulerSupport is set to true in the ActiveMQ config.

However, when I send a message to the queue, it is consumed immediately.

I even tried using the Send tool in ActiveMQ dashboard with the delay set, and that also got sent immediately.

My code to send messages:

stompit.connect({
      host: `${process.env.MQ_ID}-1.mq.eu-west-1.amazonaws.com`,
      port: 61614,
      ssl: true,
      connectHeaders: {
        'login': 'xxx',
        'passcode': 'yyy',
      },
    }, (err, client) => {
      let frame = client.send({ destination: 'TestQueue', AMQ_SCHEDULED_DELAY: 20000 });

      frame.write(JSON.stringify({foo: {bar: 'baz'}, bar: ['foo', 'bar', 'baz']}));

      frame.end();

      client.disconnect();
    });
  };