Skip to content

Commit e677048

Browse files
Handle a case where a DQT is 'quorum' but client-provided props are incompatible
1 parent 1a48bb7 commit e677048

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

deps/rabbit/src/rabbit_amqqueue.erl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,18 +747,25 @@ augment_declare_args(VHost, Durable, Exclusive, AutoDelete, Args0) ->
747747
Durable, Exclusive),
748748
IsCompatible = rabbit_queue_type:is_compatible(
749749
Type, Durable, Exclusive, AutoDelete),
750+
rabbit_log:debug("IsCompatible: ~tp, IsPermitted: ~tp, Args0: ~tp, DQT: ~tp",
751+
[IsCompatible, IsPermitted, Args0, DefaultQueueType]),
750752
case IsPermitted andalso IsCompatible of
751753
true ->
752754
%% patch up declare arguments with x-queue-type if there
753-
%% is a vhost default set the queue is druable and not exclusive
755+
%% is a vhost default set the queue is durable and not exclusive
754756
%% and there is no queue type argument
755757
%% present
756758
rabbit_misc:set_table_value(Args0,
757759
<<"x-queue-type">>,
758760
longstr,
759761
DefaultQueueType);
760762
false ->
761-
Args0
763+
%% if the properties are incompatible with the declared
764+
%% DQT, use the fall back type
765+
rabbit_misc:set_table_value(Args0,
766+
<<"x-queue-type">>,
767+
longstr,
768+
rabbit_queue_type:short_alias_of(rabbit_queue_type:fallback()))
762769
end;
763770
_ ->
764771
Args0

0 commit comments

Comments
 (0)