add the ability to create internal queues as quorum type instead of hard-coded classic - #80
Michalis-Apostolou wants to merge 7 commits into
Conversation
…ard-coded classic
iliasbibas
left a comment
There was a problem hiding this comment.
I think we need to look a bit deeper on how quorum queues handle dead lettering, a policy might be needed if we need the messages to end up in a DLQ instead of silently dropped.
@iliasbibas Are you referring to enable the |
Yes, for the delay queues I believe |
|
Btw @Michalis-Apostolou , the |
| name = this.updateName(name, prefix); | ||
| await this.connected; | ||
| await publishWithDelay(this.updateName('delay'), obj, properties, this.consumeChannel, name); | ||
| const queueName = this.scheduledPublishQueuesAsQuorum ? 'delay_quorum' : 'delay'; |
There was a problem hiding this comment.
💭 hold the naming order of quorum until SREs verify what regexps are using for alerts on delay queues (cc @a-margaritis )
it was intentional , because if there was already existing a classic queue with the same name. and you opt-in to create the same queue with different config (i.e. quorum queue type) it will conflict ungracefully and will cause to disconnect. Then there is the issue on how to resolve such conflict. you can't update a queue config. you have to destroy and recreate the queue. During the recreation of the queue in a high traffic topic may lead to message loss |
I understand that, I'm saying that in a cluster that already has a quorum queue |
set overflow and x-dead-letter-strategy to at-least-once for delayed quorum queues and delayed reply queue
Need
We need to upgrade the rmq cluster to version 4+. in this version High Availability (HA) policy with mirror queues has been deprecated and completely removed https://www.rabbitmq.com/docs/3.13/ha . So we need to replace all
classicqueue definitions withquorumProblem
Rabbit-queue creates internal queues to implement scheduled publishing for a message
{prefix}_delay_reply{prefix}_delay_{XXX}Example:

Since the library does not define the type of the queue , the are created to what is default on the virtual host.
If can't/don't want to change the default queue type of the virtual host , you should have the ability to define if these queues should be created as quorum or not.
Solution
By utilizing a new option available in the package
scheduledPublishQueuesAsQuorumon rabbit config, this will passed around during the creating of the queues.In order to avoid conflicts between already created
classicqueues and newly createdquorumqueues , the naming convention changes to{prefix}_delay_quorum_reply{prefix}_delay_quorum_{XXX}