Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nack/reject message to 'x-delayed-message' exchange with given delay time works only for first message #52

Open
srkimir opened this issue May 25, 2016 · 7 comments

Comments

@srkimir
Copy link

srkimir commented May 25, 2016

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

@srkimir srkimir changed the title nack/reject message to 'x-delayed-message' exchange type with given delay time works only for first message nack/reject message to 'x-delayed-message' exchange with given delay time works only for first message May 25, 2016
@michaelklishin
Copy link
Member

Do you have a script that we can use to reproduce?

@srkimir
Copy link
Author

srkimir commented May 25, 2016

@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
...

@srkimir
Copy link
Author

srkimir commented May 26, 2016

@michaelklishin please let me know if i can help you in any way reproducing the problem

@michaelklishin
Copy link
Member

We will get to this issue as time permits, thank you.

@gollariel
Copy link

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.

@michaelklishin
Copy link
Member

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.

@crow-ua
Copy link

crow-ua commented Apr 28, 2021

@michaelklishin is there a chance there are any updates regarding the replacement plugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants