summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Corbacho <diana@rabbitmq.com>2017-02-16 11:28:09 +0000
committerDiana Corbacho <diana@rabbitmq.com>2017-02-17 11:12:51 +0000
commitedaa714b6b00672683e4ae30a3ff9e5d42498a1f (patch)
treefd9b14abe95af1b1f50de8d4583e3bb8f7b144bb
parenta84c90db47d89aab8835deeb069dd0da872a91b6 (diff)
downloadrabbitmq-server-git-edaa714b6b00672683e4ae30a3ff9e5d42498a1f.tar.gz
Function to retrieve all exchange names (keys)
-rw-r--r--src/rabbit_exchange.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index aaea27f91a..7697621c1a 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -23,7 +23,7 @@
lookup/1, lookup_or_die/1, list/0, list/1, lookup_scratch/2,
update_scratch/3, update_decorators/1, immutable/1,
info_keys/0, info/1, info/2, info_all/1, info_all/2, info_all/4,
- route/2, delete/2, validate_binding/2]).
+ route/2, delete/2, validate_binding/2, list_names/0]).
%% these must be run inside a mnesia tx
-export([maybe_auto_delete/2, serial/1, peek_serial/1, update/2]).
@@ -61,6 +61,7 @@
(name()) -> rabbit_types:exchange() |
rabbit_types:channel_exit().
-spec list() -> [rabbit_types:exchange()].
+-spec list_names() -> [rabbit_exchange:name()].
-spec list(rabbit_types:vhost()) -> [rabbit_types:exchange()].
-spec lookup_scratch(name(), atom()) ->
rabbit_types:ok(term()) |
@@ -258,6 +259,8 @@ lookup_or_die(Name) ->
list() -> mnesia:dirty_match_object(rabbit_exchange, #exchange{_ = '_'}).
+list_names() -> mnesia:dirty_all_keys(rabbit_exchange).
+
%% Not dirty_match_object since that would not be transactional when used in a
%% tx context
list(VHostPath) ->