Skip to content

add the ability to create internal queues as quorum type instead of hard-coded classic - #80

Open
Michalis-Apostolou wants to merge 2 commits into
masterfrom
option_create_delayed_queues_and_reply_as_quorum
Open

add the ability to create internal queues as quorum type instead of hard-coded classic#80
Michalis-Apostolou wants to merge 2 commits into
masterfrom
option_create_delayed_queues_and_reply_as_quorum

Conversation

@Michalis-Apostolou

Copy link
Copy Markdown

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 classic queue definitions with quorum

Problem

Rabbit-queue creates internal queues to implement scheduled publishing for a message

  1. there is a queue created on app connect {prefix}_delay_reply
  2. The publisher for a delayed messaged for XXX amount creates the queue {prefix}_delay_{XXX}

Example:
image

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 the option available in the package defaultQueueType on rabbit config, this will passed around during the creating of the queues.
In order to avoid conflicts between already created classic queues and newly created quorum queues , the naming convention changes to

  1. {prefix}_delay_quorum_reply
  2. {prefix}_delay_quorum_{XXX}
image

Comment thread test/delay-queue.test.ts Outdated
'delay',
{
deadLetterExchange: '',
deadLetterRoutingKey: 'delay_reply',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be delay_quorum_reply?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is derived by module's variable delayedQueueNameReply

deadLetterRoutingKey: delayedQueueNameReply,
which is set by createDelayQueueReply parameter.
Amended the test , to also call createDelayQueueReply with createQueueAsQuorum , so it set the expected queue name.

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

Successfully merging this pull request may close these issues.

2 participants