Skip to content

Commit 1792fff

Browse files
committed
rabbit_vhost: Allow vhosts with not-enabled default queue types
The prior validation for vhosts' default queue types ensures that the default queue type can be declared. This seems slightly heavy-handed since users might never rely on default-queue-type behavior. Instead the creation of the vhost should succeed but warn the user that declarations relying on the default queue type will fail - the `is_enabled/0` callback of `rabbit_queue_type` should be limited to block queue declarations, and not block the creation of a vhost.
1 parent cae2b4b commit 1792fff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

deps/rabbit/src/rabbit_vhost.erl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,12 @@ do_add(Name, Metadata0, ActingUser) ->
215215
true ->
216216
ok;
217217
false ->
218-
throw({error, queue_type_feature_flag_is_not_enabled})
218+
?LOG_WARNING("Default queue type '~ts' of virtual "
219+
"host '~ts' is not enabled. All "
220+
"declarations relying on the default "
221+
"queue type will fail.",
222+
[QueueType, Name]),
223+
ok
219224
end
220225
catch _:_ ->
221226
throw({error, invalid_queue_type, DQT})

0 commit comments

Comments
 (0)