Skip to content
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

Fix #13009, STOMP: default to exclusive queues except stream queues #13016

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions deps/amqp_client/src/rabbit_routing_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,28 @@ queue_declare_method(#'queue.declare'{} = Method, Type, Params) ->
false -> Method#'queue.declare'{auto_delete = true,
exclusive = true}
end,

%% set the rest of queue.declare fields from Params
Method2 = lists:foldl(fun (F, Acc) -> F(Acc, Params) end,
Method1, [fun update_queue_declare_arguments/2,
fun update_queue_declare_exclusive/2,
fun update_queue_declare_auto_delete/2,
fun update_queue_declare_nowait/2]),

Arguments = proplists:get_value(arguments, Params, []),
QueueType = rabbit_amqqueue:get_queue_type(Arguments),

Method3 = case QueueType of
rabbit_stream_queue -> Method2#'queue.declare'{durable = true,
exclusive = false};
_ -> Method2
end,

case {Type, proplists:get_value(subscription_queue_name_gen, Params)} of
{topic, SQNG} when is_function(SQNG) ->
Method2#'queue.declare'{queue = SQNG()};
Method3#'queue.declare'{queue = SQNG()};
{exchange, SQNG} when is_function(SQNG) ->
Method2#'queue.declare'{queue = SQNG()};
Method3#'queue.declare'{queue = SQNG()};
_ ->
Method2
Method3
end.
3 changes: 2 additions & 1 deletion deps/rabbitmq_stomp/src/rabbit_stomp_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ default_params({topic, _}) ->
[{exclusive, false}, {auto_delete, true}];

default_params(_) ->
[{durable, false}].
[{exclusive, true},
{durable, false}].

string_to_boolean("True") ->
true;
Expand Down
Loading