rabbitmq-delayed-message-exchange
rabbitmq-delayed-message-exchange copied to clipboard
nack/reject message to 'x-delayed-message' exchange with given delay time works only for first message
What i'm trying to do with the plugin is to nack/reject message to dead letter exchange (which has a type equal to 'x-delayed-message') if there was any recoverableError during message processing.
Only first nacked/rejected message that gets to dead letter exchange will be published to given queue after x-delay time, all other succeeding messages that will be nacked/rejected will be published immediately when they arrive at dead letter exchange.
From my debugging what i can see is that plugin will set negative 'x-delay' to all other messages except first one. Not quite sure is this a bug nor plugin doesn't play good with nack/reject messages or this is intended behaviour?
If it is intended behaviour how one can implement described scenario with plugin?
What can be solution, as it seems to me, is to explicitly (instead nack/reject) publish to dead letter exchange with (re) setting x-delay on every publish, but why to throw away comfort that comes with .nack() or .reject().
Gist: https://gist.github.com/srkimir/7d20576fa5b47dcd7b21f1950ace8cf9 Topology: https://docs.google.com/drawings/d/1hlBHwFT4Xm4Nb6B0tEv4nEldTqgzDqUoNl_M3QTwuB4
Do you have a script that we can use to reproduce?
@michaelklishin Thanks on fast response. Can you use gist from question? https://gist.github.com/srkimir/7d20576fa5b47dcd7b21f1950ace8cf9
I updated gist to contain few console.logs:
Message initialy published at 2016-05-25T23:53:15.027Z
Message consumed at 2016-05-25T23:53:15.030Z, with x-delay = 1000
REJECTED
Message consumed at 2016-05-25T23:53:16.037Z, with x-delay = -1000 // only this message is delayed for one second
REJECTED
Message consumed at 2016-05-25T23:53:16.039Z, with x-delay = -1000
...
@michaelklishin please let me know if i can help you in any way reproducing the problem
We will get to this issue as time permits, thank you.
Any news regarding this issue? Looks like this is very old issue Currently, I found one way to avoid the problem, this is Send Message again, and make Nack for the old one, but this is a hack.
The update is that this plugin will be replaced by a different one. There is no ETA or delivery promises of any kind. This is open source software, so those who need a short term solution are welcome to contribute it.
@michaelklishin is there a chance there are any updates regarding the replacement plugin?