Skip to content

Commit baa407d

Browse files
Merge pull request #200 from rabbitmq/no-direct-exchange-routing-v2
Continue to use direct exchange routing v1
2 parents d6ad4da + ab581d7 commit baa407d

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/rabbit_exchange_type_delayed_message.erl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,21 @@ description() ->
4040
[{name, <<"x-delayed-message">>},
4141
{description, <<"Delayed Message Exchange.">>}].
4242

43-
route(X, Delivery) ->
43+
route(X = #exchange{name = Name},
44+
Delivery = #delivery{message = #basic_message{routing_keys = RKeys}}) ->
4445
case delay_message(X, Delivery) of
4546
nodelay ->
4647
%% route the message using proxy module
47-
?EXCHANGE(X):route(X, Delivery);
48+
case ?EXCHANGE(X) of
49+
rabbit_exchange_type_direct ->
50+
%% Exchange type x-delayed-message routes via "direct exchange routing v1"
51+
%% even when feature flag direct_exchange_routing_v2 is enabled because
52+
%% table rabbit_index_route only stores bindings whose source exchange
53+
%% is of type direct exchange.
54+
rabbit_router:match_routing_key(Name, RKeys);
55+
Mod ->
56+
Mod:route(X, Delivery)
57+
end;
4858
_ ->
4959
[]
5060
end.

test/plugin_SUITE.erl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ e2e_nodelay(Config) ->
150150
e2e_test0(Config, [0]).
151151

152152
e2e_delay(Config) ->
153-
%% message delay will be 0,
154-
%% we are testing e2e without delays
155153
e2e_test0(Config, [500, 100, 300, 200, 100, 400]).
156154

157155
e2e_test0(Config, Msgs) ->

0 commit comments

Comments
 (0)