summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index bd9d76323a..b3fc17b05d 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -272,9 +272,7 @@ handle_cast({method, Method, Content, Flow},
flow -> credit_flow:ack(Reader);
noflow -> ok
end,
- %% handle MRDQ before calling handle method
- M = expand_shortcuts(Method, State),
- try handle_method(rabbit_channel_interceptor:intercept_method(M),
+ try handle_method(intercept_method(Method, State),
Content, State) of
{reply, Reply, NewState} ->
ok = send(Reply, NewState),
@@ -558,7 +556,7 @@ expand_shortcuts(#'queue.bind' {queue = Q, routing_key = K} = M, State) ->
M#'queue.bind' {queue = expand_queue_name_shortcut(Q, State),
routing_key = expand_routing_key_shortcut(Q, K, State)};
expand_shortcuts(#'queue.unbind' {queue = Q, routing_key = K} = M, State) ->
- M#'queue.bind' {queue = expand_queue_name_shortcut(Q, State),
+ M#'queue.unbind' {queue = expand_queue_name_shortcut(Q, State),
routing_key = expand_routing_key_shortcut(Q, K, State)};
expand_shortcuts(M, _State) ->
M.
@@ -1696,3 +1694,8 @@ erase_queue_stats(QName) ->
[erase({queue_exchange_stats, QX}) ||
{{queue_exchange_stats, QX = {QName0, _}}, _} <- get(),
QName0 =:= QName].
+
+intercept_method(Method, State) ->
+ %% handle MRDQ before calling intercept_method
+ rabbit_channel_interceptor:intercept_method(
+ expand_shortcuts(Method, State)). \ No newline at end of file