I can't seem to figure out how to pass it the proper options to get the Delayed Message Plugin to work properly when using servicebus.
My current attempt is as follows:
Consumer:
const options = {
ack: true,
queueOptions: {
exchangeOptions: {
type: 'x-delayed-message',
'x-delayed-type': 'direct'
}
}
};
bus.listen(eventName, options, handlerFunc);
Producer:
const options = {
ack: true,
headers: {
'x-delay': 1000
}
}
bus.send(eventName, message, options);
The message sends and is received by the listener immediately (~100ms).
I'm wondering if I am not providing the information correctly on the headers on the send or with exchangeOptions on the listen. Or perhaps servicebus just doesn't support propagating these settings into the RabbitMQ queue/message properly.
Any help is appreciated.
I can't seem to figure out how to pass it the proper options to get the Delayed Message Plugin to work properly when using servicebus.
My current attempt is as follows:
Consumer:
Producer:
The message sends and is received by the listener immediately (~100ms).
I'm wondering if I am not providing the information correctly on the
headerson thesendor withexchangeOptionson thelisten. Or perhaps servicebus just doesn't support propagating these settings into the RabbitMQ queue/message properly.Any help is appreciated.