diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_control.erl | 13 |
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). |
