-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DEVEX-2399]: Make errored queues configurable #213
base: master
Are you sure you want to change the base?
[DEVEX-2399]: Make errored queues configurable #213
Conversation
BREAKING CHANGE: if `Helper.declare` is used with a non-default queue type this will try to change the dead letter queue type causing an error
35fea46
to
f9ee7dc
Compare
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.
Should there be a x-dead-letter-queue-type
option, to allow overwriting the default behavior?
:queue => Basic.queue(), | ||
:exchange => Basic.exchange(), | ||
:routing_key => String.t(), | ||
optional(:original_routing_keys) => [String.t() | [String.t()]], |
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.
When is this a nested array?
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.
here declare
creates a nested string list
Line 104 in f9ee7dc
original_routing_keys = Enum.map(exchanges, & &1.routing_keys) |
we should probably use a flat_map
and remove the flatten
I've briefly looked at other rabbit/amqp clients, it seems none of them automatically create dead letter queues as |
Currently
Helper.declare/2
creates a dead letter queue when the arguments contains a tuple like{"x-dead-letter-exchange", :longstr, dle}
.Since rabbit 4.0 will remove queue mirroring for classic queues, many queues need to be migrated to
quorum
. Howeverdeclare/2
will always use the default type for dead letters, so we need a mechanism to change their types.Ideally I'd like to refactor the Helper module, as its functions have a complex interface that has proven difficult to maintain and does not consistently behave as expected.
Unfortunately, many applications depend on
declare/2
to setup both the queue and its dead letter. When{"x-queue-type", :longstr, "quorum"}
is passed in the arguments amqpx will create a quorum queue and a classic dead letter, which is likely not the desired behavior.The current plan is to use the same
x-queue-type
for both the queue and its dead letter. This change will be introduced in amqpx 7.0 as a breaking update, aiming to minimize the number of applications with mismatched queue types for dead letters.ref: https://prima-assicurazioni-spa.myjetbrains.com/youtrack/issue/DEVEX-2399