Skip to content

Commit

Permalink
Listing consumer groups (#442)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fmcdonal authored Apr 21, 2022
1 parent 6e8716f commit 7f44d57
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions docs/kafka/consumer-configuration-kafka/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,45 @@ Consumers within a group don’t read data from the same partition, but can read
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}.
If required, use the {product-kafka} web console to reset the offsets of consumer groups or delete consumer groups.

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.
//Additional line break to resolve mod docs generation error
[id="con-consumer-group-list_{context}"]
== Listing consumer groups

[role="_abstract"]
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.

ifndef::community[]
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.
endif::[]

//Additional line break to resolve mod docs generation error

[id="con-consumer-group-list-using-CLI_{context}"]
=== Listing consumer groups using the CLI

To use the `rhoas` command-line interface (CLI) to list the consumer groups defined for your Kafka instance, enter the following command:


[source,subs="+quotes,+attributes"]
----
rhoas kafka consumer-group list
----

When you enter the preceding command, you should see output similar to the following example:

[source,subs="+quotes,+attributes"]
----
CONSUMER GROUP ID ACTIVE MEMBERS PARTITIONS WITH LAG
------------------- ---------------- ---------------------
consumergroup1 2 0
consumergroup2 1 0
----

[id="con-consumer-group-script_{context}"]
== Connecting the Kafka consumer group script
=== Connecting the Kafka consumer group script

[role="_abstract"]
If you're using the `kafka-consumer-groups.sh` script, or any other Kafka scripts,
you'll need to use the `--bootstrap-server` and `--command-config` flags to connect to your Kafka instance.
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:

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

0 comments on commit 7f44d57

Please sign in to comment.