[Messenger] Rabbitmq delayed quorum queues #60298
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As described in the issue: #57867 when we create delayed quorum queues this doesn't update the expire time.
I've first tried what is suggested by rabbit maintainers here: rabbitmq/rabbitmq-server#5894 (comment) but it doesn't supported either.
So the final solution is create a delayed quorum queue per day, with expire of one day + ttl + 10 seconds, with this approach, when you enqueue a message to a delayed queue, you'll be sure that all the delayed message of the same day will be in the same queue and this queue won't die before the last message is processed.
For example you delay a message with 10s delay at 10:00 of 2025-04-29, this will create a delayed queue named:
delay_test_test_delay_2025-04-29 with expire on 2025-04-30 at 10:10:10.
If another message comes at 23:59:59, it will go to the same queue, that is already created.
And in the next day will create a new queue for the 30th.