Skip to content

Commit 7f44d57

Browse files
authored
Listing consumer groups (#442)
* moved the existing note in section 3 to the beginning and added new section for Listing consumer groups using the CLI. * updated the Listing consumer groups with subsections to improve the structure * removed duplication * replaced alternatively with in addition
1 parent 6e8716f commit 7f44d57

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

docs/kafka/consumer-configuration-kafka/README.adoc

+29-6
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,45 @@ Consumers within a group don’t read data from the same partition, but can read
6868
As a developer of applications and services, you can view all the consumer groups that have access to a particular Kafka instance in {product-kafka}.
6969
If required, use the {product-kafka} web console to reset the offsets of consumer groups or delete consumer groups.
7070

71-
As an alternative to using the {product-kafka} web console, you can use the `rhoas` command-line interface (CLI) or the Kafka `kafka-consumer-groups.sh` script to review and update consumer groups.
71+
//Additional line break to resolve mod docs generation error
72+
[id="con-consumer-group-list_{context}"]
73+
== Listing consumer groups
74+
75+
[role="_abstract"]
76+
In addition to the {product-kafka} web console, you can use the `rhoas` command-line interface (CLI) or the Kafka `kafka-consumer-groups.sh` script to list consumer groups for your Kafka instance. The following subsections describe how to use these methods to list consumer groups.
7277

7378
ifndef::community[]
7479
NOTE: The Kafka scripts are part of the open source community version of Apache Kafka. The scripts are not a part of {product-kafka} and are therefore not supported by Red Hat.
7580
endif::[]
7681

77-
//Additional line break to resolve mod docs generation error
82+
83+
[id="con-consumer-group-list-using-CLI_{context}"]
84+
=== Listing consumer groups using the CLI
85+
86+
To use the `rhoas` command-line interface (CLI) to list the consumer groups defined for your Kafka instance, enter the following command:
87+
88+
89+
[source,subs="+quotes,+attributes"]
90+
----
91+
rhoas kafka consumer-group list
92+
----
93+
94+
When you enter the preceding command, you should see output similar to the following example:
95+
96+
[source,subs="+quotes,+attributes"]
97+
----
98+
CONSUMER GROUP ID ACTIVE MEMBERS PARTITIONS WITH LAG
99+
------------------- ---------------- ---------------------
100+
consumergroup1 2 0
101+
consumergroup2 1 0
102+
----
78103

79104
[id="con-consumer-group-script_{context}"]
80-
== Connecting the Kafka consumer group script
105+
=== Connecting the Kafka consumer group script
81106

82107
[role="_abstract"]
83-
If you're using the `kafka-consumer-groups.sh` script, or any other Kafka scripts,
84-
you'll need to use the `--bootstrap-server` and `--command-config` flags to connect to your Kafka instance.
108+
You can list consumer groups using the `kafka-consumer-groups.sh` script. To use this or any other Kafka scripts, you need to specify the `--bootstrap-server` and `--command-config` flags to connect to your Kafka instance. To list consumer groups, enter the following command:
85109

86-
.Command to list all consumer groups
87110
[source,subs="+quotes,+attributes"]
88111
----
89112
./kafka-consumer-groups.sh --bootstrap-server __<bootstrap_server>__ --command-config __<authentication_properties>__ --list

0 commit comments

Comments
 (0)