-
Notifications
You must be signed in to change notification settings - Fork 37
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
Always use x-dead-letter-exchange when deliver a delayed message #748
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice :)
Shouldnt we prevent publishing directly to that internal queue instead? That the default exchange cant route to the queue? |
This will cause a performance hit as the headers have to be parsed for each message twice. Not critical for this exchange type, but we should be aware of it. |
Yes, this is a "quick fix" and then we need to discuss how to limit internal queues. |
Btw, which header parsing are you referring too? |
That's much better! |
WHAT is this pull request doing?
When an exchange is delayed it will create a queue and use message expiration and dead lettering for the delay. When a message is published to the exchange it will put the message in the "delay queue", and when the message is expired it will be republished to the message's exchange and the message is routed.
However, it's possible to publish messages to this queue via the default exchange and then the exchange field of the message is an empty string. This caused the message to be republished to the default exchange instead of the delayed exchange, resulting in the message looping between the queue and default exchange causing lavinmq to freeze.
This PR will make sure that the
x-dead-letter-exchange
argument for the queue is used when the messages is republished due to expiration.HOW can this pull request be tested?
Run specs