Skip to content

Commit 35d8a1d

Browse files
committed
Prevent attach to volatile queue if FF disabled
1 parent 660638d commit 35d8a1d

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

deps/rabbit/src/rabbit_amqp_session.erl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,12 +2754,14 @@ ensure_source(#'v1_0.source'{
27542754
} = Source0,
27552755
SndSettled, LinkName, Vhost, User, ContainerId,
27562756
ConnPid, PermCache0, TopicPermCache) ->
2757+
FFEnabled = rabbit_volatile_queue:ff_enabled(),
27572758
case maps:from_keys(Caps, true) of
27582759
#{{symbol, ?CAP_RABBITMQ_VOLATILE_QUEUE} := true}
2759-
when Durable =:= ?V_1_0_TERMINUS_DURABILITY_NONE andalso
2760+
when (Durable =:= undefined orelse Durable =:= ?V_1_0_TERMINUS_DURABILITY_NONE) andalso
27602761
ExpiryPolicy =:= ?V_1_0_TERMINUS_EXPIRY_POLICY_LINK_DETACH andalso
27612762
(Timeout =:= undefined orelse Timeout =:= {uint, 0}) andalso
2762-
SndSettled ->
2763+
SndSettled andalso
2764+
FFEnabled ->
27632765
%% create volatile queue
27642766
QNameBin = rabbit_volatile_queue:generate_name(self()),
27652767
Source = #'v1_0.source'{
@@ -2798,7 +2800,7 @@ ensure_source(#'v1_0.source'{
27982800
exit_not_implemented("Dynamic source not supported: ~tp", [Source0])
27992801
end;
28002802
ensure_source(Source = #'v1_0.source'{dynamic = true}, _, _, _, _, _, _, _, _) ->
2801-
exit_not_implemented("Dynamic source not supported: ~p", [Source]);
2803+
exit_not_implemented("Dynamic source not supported: ~tp", [Source]);
28022804
ensure_source(Source0 = #'v1_0.source'{address = Address,
28032805
durable = Durable},
28042806
_SndSettle, _LinkName, Vhost, User, _ContainerId,

deps/rabbit/src/rabbit_volatile_queue.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
key_from_name/1,
2222
pid_from_name/2,
2323
deliver_local/3,
24-
exists/1]).
24+
exists/1,
25+
ff_enabled/0]).
2526

2627
-export([declare/2,
2728
supports_stateful_delivery/0,

deps/rabbit/test/amqp_auth_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,8 @@ attach_source_queue_dynamic_exclusive(Config) ->
482482
ok = close_connection_sync(Connection).
483483

484484
attach_source_queue_dynamic_volatile(Config) ->
485+
ok = rabbit_ct_broker_helpers:enable_feature_flag(Config, 'rabbitmq_4.2.0'),
486+
485487
OpnConf = connection_config(Config),
486488
{ok, Connection} = amqp10_client:open_connection(OpnConf),
487489
{ok, Session} = amqp10_client:begin_session_sync(Connection),

deps/rabbit/test/direct_reply_to_amqp_SUITE.erl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,11 @@ init_per_group(Group, Config) ->
6969
Config1,
7070
rabbit_ct_broker_helpers:setup_steps() ++
7171
rabbit_ct_client_helpers:setup_steps()),
72-
case Nodes of
73-
1 ->
72+
case rabbit_ct_broker_helpers:enable_feature_flag(Config2, 'rabbitmq_4.2.0') of
73+
ok ->
7474
Config2;
75-
_ ->
76-
case rabbit_ct_broker_helpers:enable_feature_flag(Config2, 'rabbitmq_4.2.0') of
77-
ok ->
78-
Config2;
79-
{skip, _} = Skip ->
80-
Skip
81-
end
75+
{skip, _} = Skip ->
76+
Skip
8277
end.
8378

8479
end_per_group(_Group, Config) ->

deps/rabbit/test/direct_reply_to_amqpl_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ amqpl_amqp_amqpl(Config) ->
354354
%% Test that Direct Reply-To works when the requester is an AMQP 1.0 client
355355
%% and the responder is an AMQP 0.9.1 client.
356356
amqp_amqpl_amqp(Config) ->
357+
ok = rabbit_ct_broker_helpers:enable_feature_flag(Config, 'rabbitmq_4.2.0'),
358+
357359
RequestQ = atom_to_binary(?FUNCTION_NAME),
358360
AddrRequestQ = rabbitmq_amqp_address:queue(RequestQ),
359361
Id = <<"🥕"/utf8>>,

0 commit comments

Comments
 (0)