summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2010-02-02 19:37:04 +0000
committerMatthias Radestock <matthias@lshift.net>2010-02-02 19:37:04 +0000
commit82d3065e1303085f5bf590a4f21f561161ed2fd9 (patch)
tree5d925ee375bbea19cb0b928b8003fe30d349befd /src
parent19642833f120e6b52fd41e77f37d57b40504f74e (diff)
downloadrabbitmq-server-git-82d3065e1303085f5bf590a4f21f561161ed2fd9.tar.gz
add 'rabbitmqctl list_consumers' command
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_control.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index 738ed444f4..232b3c8f43 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -159,6 +159,7 @@ Available commands:
list_bindings [-p <VHostPath>]
list_connections [<ConnectionInfoItem> ...]
list_channels [<ChannelInfoItem> ...]
+ list_consumers
Quiet output mode is selected with the \"-q\" flag. Informational
messages are suppressed when quiet mode is in effect.
@@ -197,6 +198,9 @@ vhost, transactional, consumer_count, messages_unacknowledged,
prefetch_count]. The default is to display pid, user, transactional,
consumer_count, messages_unacknowledged.
+The output format for \"list_consumers\" is a list of rows containing
+the channel process id, consumer tag and queue name, in that order.
+
"),
halt(1).
@@ -314,6 +318,15 @@ action(list_channels, Node, Args, Inform) ->
display_info_list(rpc_call(Node, rabbit_channel, info_all, [ArgAtoms]),
ArgAtoms);
+action(list_consumers, Node, [], Inform) ->
+ Inform("Listing consumers", []),
+ InfoKeys = [channel_pid, consumer_tag, queue_name],
+ display_info_list(
+ [lists:zip(InfoKeys, tuple_to_list(X)) ||
+ X <- rpc_call(Node, rabbit_channel, consumers_all, [])],
+ InfoKeys),
+ ok;
+
action(Command, Node, Args, Inform) ->
{VHost, RemainingArgs} = parse_vhost_flag(Args),
action(Command, Node, VHost, RemainingArgs, Inform).