diff options
| -rw-r--r-- | src/rabbit_exchange.erl | 10 |
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, |
