summaryrefslogtreecommitdiff
path: root/src/rabbit_router.erl
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-09-12 16:49:20 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-09-12 16:49:20 +0100
commit9ffaa55446fbe90d145dd23cf48ae640f360bf84 (patch)
treedf3c384fd8f885a065a20754e64ccad54fc7837e /src/rabbit_router.erl
parent23a13253ad858dd17804e34766bd17d05a0213fa (diff)
downloadrabbitmq-server-9ffaa55446fbe90d145dd23cf48ae640f360bf84.tar.gz
exchange_name => source; consistent naming of Src{Name} and Dst{Name}, except in rabbit_exchange when we clearly are talking only about exchanges; improvements to rabbit_control so that list_bindings returns the type of the endpoints as well as the endpoint names
Diffstat (limited to 'src/rabbit_router.erl')
-rw-r--r--src/rabbit_router.erl14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rabbit_router.erl b/src/rabbit_router.erl
index 89bafb8a..c5a1c440 100644
--- a/src/rabbit_router.erl
+++ b/src/rabbit_router.erl
@@ -83,21 +83,21 @@ deliver(QPids, Delivery) ->
%% TODO: Maybe this should be handled by a cursor instead.
%% TODO: This causes a full scan for each entry with the same exchange
-match_bindings(XName, Match) ->
+match_bindings(SrcName, Match) ->
Query = qlc:q([DestinationName ||
#route{binding = Binding = #binding{
- exchange_name = XName1,
+ source = SrcName1,
destination = DestinationName}} <-
mnesia:table(rabbit_route),
- XName == XName1,
+ SrcName == SrcName1,
Match(Binding)]),
partition_destinations(mnesia:async_dirty(fun qlc:e/1, [Query])).
-match_routing_key(XName, RoutingKey) ->
- MatchHead = #route{binding = #binding{exchange_name = XName,
+match_routing_key(SrcName, RoutingKey) ->
+ MatchHead = #route{binding = #binding{source = SrcName,
destination = '$1',
- key = RoutingKey,
- _ = '_'}},
+ key = RoutingKey,
+ _ = '_'}},
partition_destinations(
mnesia:dirty_select(rabbit_route, [{MatchHead, [], ['$1']}])).