summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hood <0x6e6562@gmail.com>2008-09-21 18:17:55 +0100
committerBen Hood <0x6e6562@gmail.com>2008-09-21 18:17:55 +0100
commit63a3c7641f4eb6ada58b5eaf28f65299400e2bea (patch)
treea49e0d7dccaafe8125164dc6d7f7bfd01df4fab5
parent941d8a3740bd0a45e70b9211c2eb6b9561c9cf67 (diff)
downloadrabbitmq-server-git-63a3c7641f4eb6ada58b5eaf28f65299400e2bea.tar.gz
Added a comment about the complexity of the mnesia:select usage
-rw-r--r--src/rabbit_exchange.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index c6fdb6eedb..df94131ce0 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -212,6 +212,16 @@ route(#exchange{name = Name, type = topic}, RoutingKey) ->
topic_matches(BindingKey, RoutingKey)]),
lookup_qpids(mnesia:activity(async_dirty, fun() -> qlc:e(Query) end));
+% This mnesia:select is complicated because the exchange component of the
+% match head cannot be matched against a tuple. Hence I had to decompose
+% a tuple match for an exchange into individual matches for its constituent
+% parts. For reference, the code that does not seem to work is this:
+% ...
+% MatchHead = #route{binding = #binding{exchange_name = $1,
+% queue_name = '$3',
+% key = '$2'}},
+% Guards = [{'==', '$1', Name}, {'==', '$2', RoutingKey}],
+% ...
route(#exchange{name = #resource{name = Name, virtual_host = VHostPath}}, RoutingKey) ->
Exchange = #resource{kind = exchange, name ='$1',virtual_host = '$2'},
MatchHead = #route{binding = #binding{exchange_name = Exchange,