summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-08-14 14:05:10 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-08-14 14:05:10 +0100
commit8fe8abb282208d552da7c306c41f44269ba3a8b6 (patch)
tree2090e1a49a462e824d811950810ab0d53def6272 /src
parent4fd1c5c03417a5b4976f620d67fad36c12e40076 (diff)
downloadrabbitmq-server-git-8fe8abb282208d552da7c306c41f44269ba3a8b6.tar.gz
Remove support for decorators to modify routing for the default exchange; it doesn't make a ton of sense. Also no longer describe this as an optimisation since some of it is more than that.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_exchange.erl11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index 3ca83e4a5a..3dc15d6b55 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -344,17 +344,16 @@ info_all(VHostPath, Items) -> map(VHostPath, fun (X) -> info(X, Items) end).
route(#exchange{name = #resource{virtual_host = VHost, name = RName} = XName,
decorators = Decorators} = X,
#delivery{message = #basic_message{routing_keys = RKs}} = Delivery) ->
- case {RName, rabbit_exchange_decorator:select(route, Decorators)} of
- {<<"">>, []} ->
- %% Optimisation
- %% TODO what if there are decorators? Is that even a sane case?
+ case RName of
+ <<>> ->
RKsSorted = lists:usort(RKs),
[rabbit_channel:deliver_reply(RK, Delivery) ||
RK <- RKsSorted, virtual_reply_queue(RK)],
[rabbit_misc:r(VHost, queue, RK) || RK <- RKsSorted,
not virtual_reply_queue(RK)];
- {_, SelectedDecorators} ->
- lists:usort(route1(Delivery, SelectedDecorators, {[X], XName, []}))
+ _ ->
+ Decs = rabbit_exchange_decorator:select(route, Decorators),
+ lists:usort(route1(Delivery, Decs, {[X], XName, []}))
end.
virtual_reply_queue(<<"amq.rabbitmq.reply-to.", _/binary>>) -> true;