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

Continue to use direct exchange routing v1 #200

Merged
merged 1 commit into from
May 20, 2022
Merged
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
14 changes: 12 additions & 2 deletions src/rabbit_exchange_type_delayed_message.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,21 @@ description() ->
[{name, <<"x-delayed-message">>},
{description, <<"Delayed Message Exchange.">>}].

route(X, Delivery) ->
route(X = #exchange{name = Name},
Delivery = #delivery{message = #basic_message{routing_keys = RKeys}}) ->
case delay_message(X, Delivery) of
nodelay ->
%% route the message using proxy module
?EXCHANGE(X):route(X, Delivery);
case ?EXCHANGE(X) of
rabbit_exchange_type_direct ->
%% Exchange type x-delayed-message routes via "direct exchange routing v1"
%% even when feature flag direct_exchange_routing_v2 is enabled because
%% table rabbit_index_route only stores bindings whose source exchange
%% is of type direct exchange.
rabbit_router:match_routing_key(Name, RKeys);
Mod ->
Mod:route(X, Delivery)
end;
_ ->
[]
end.
Expand Down
2 changes: 0 additions & 2 deletions test/plugin_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ e2e_nodelay(Config) ->
e2e_test0(Config, [0]).

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

e2e_test0(Config, Msgs) ->
Expand Down