Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group
Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers).
TOPIC                          PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG        CONSUMER-ID                                       HOST                           CLIENT-ID
my-topic                       10          3085716577           11832033154           8746316577      consumer2consumer1-5d3a62da81fe8a2a-abe10b29-427d4964-a9e9a1d4-4962c35f2dae4741582132bb    /127.0.0.1                     consumer2consumer1
my-topic                       1 2         16578 30857          33155 118320          8746316577      consumer3consumer1-ad71338d81fe8a2a-d3790b29-4cff4964-be2da1d4-1e3971f32f514741582132bb    /127.0.0.1                     consumer3consumer1
my-topic                       2 0         16577 31357          33155 118320          8696316578      consumer1consumer2-5e864292db6f12f2-bef0e1de-45f14bb7-9b9693ec-ea56943609e76170fefa8830    /127.0.0.1                     consumer1consumer2
my-second-topic                0           33023   -        44543  -         11520      -               -          consumer4-e173f09d-c761-4f4e-95c7-6fb73bb8fbffconsumer7-c1d056fa-eabc-42ed-b557-c848f747ec49    /127.0.0.1                     consumer4consumer7
-                              -          -               -               -          consumer5consumer8-7b80e4286078de6a-f8ffaf63-43f34c7a-83608bad-afd1c8ba43eaf03cb3606075    /127.0.0.1                     consumer5consumer8
my-other-topic                 1          68957901            68958652            0  751        -                                                 -                              -
my-other-topic                 0          68947902            68948654            0  752        -                                                 -                              -

The information included in the command output includes:

...

Code Block
languagebash
$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group
Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers).
TOPIC                          PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG        CONSUMER-ID                                       HOST                           CLIENT-ID
my-topic                       0 1         16577 30857          33154 118320          8746316577      consumer2consumer1-5d3a62da81fe8a2a-abe10b29-427d4964-a9e9a1d4-4962c35f2dae4741582132bb    /127.0.0.1                     consumer2consumer1
my-topic                       1 2         16578 30857          33155 118320          8746316577      consumer3consumer1-ad71338d81fe8a2a-d3790b29-4cff4964-be2da1d4-1e3971f32f514741582132bb    /127.0.0.1                     consumer3consumer1
my-topic                       02          3135716577           33155 118320          8696316578      consumer1consumer2-5e864292db6f12f2-bef0e1de-45f14bb7-9b9693ec-ea56943609e76170fefa8830    /127.0.0.1                     consumer1consumer2
my-othersecond-topic                0 1         33023 6895          44543  6895         11520   0   consumer7-c1d056fa-eabc-42ed-b557-c848f747ec49    /127.0.0.1   -                  consumer7
my-other-topic                 1          7901    -        8652            751          -
my-other-topic-                                   0          6894    -        6894            0          -
my-other-topic                 0          7902            8654            752        -                                     -

--describe --members

A new option --members is introduced that is allowed with --describe only and returns info about active members of the group along with their assigned topic partitions:

            -                              -

Note that consumers without any assigned partitions will no longer appear in the listing.

--describe --members

A new option --members is introduced that is allowed with --describe only and returns info about active members of the group along with their assigned topic partitions:

Code Block
languagebash
$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group --members
Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers).
CONSUMER-ID                                       HOST                           CLIENT-ID              #PARTITIONS     ASSIGNMENT-STRATEGY
consumer1-81fe8a2a-0b29-4964-a1d4-4741582132bb    /127.0.0.1                     consumer1              2               range
consumer2-db6f12f2-e1de-4bb7-93ec-6170fefa8830    /127.0.0.1                     consumer2              1               range, round-robin
consumer7-c1d056fa-eabc-42ed-b557-c848f747ec49    /127.0.0.1                     consumer7              1               range

–describe --offsets

The new --offsets option, that is allowed with --describe only, produces the same result as the --describe option itself. In other words, --offsets is the default sub-option of --describe:

Code Block
languagebash
$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group --offsets
Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers).
TOPIC                          PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG        CONSUMER-ID                                       HOST                           CLIENT-ID
my-topic                       0          16577           33154           16577      consumer1-81fe8a2a-0b29-4964-a1d4-4741582132bb    /127.0.0.1                     consumer1
my-topic                       1          16578           33155           16577      consumer1-81fe8a2a-0b29-4964-a1d4-4741582132bb    /127.0.0.1                     consumer1
my-topic                       2          16577           33155           16578      consumer2-db6f12f2-e1de-4bb7-93ec-6170fefa8830    /127.0.0.1                     consumer2
my-second-topic                0          33023           44543           11520      consumer7-c1d056fa-eabc-42ed-b557-c848f747ec49    /127.0.0.1                     consumer7
my-other-topic                 1          7901            8652            751        -
Code Block
languagebash
$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group --members
Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers).
CONSUMER-ID                                       HOST                -           CLIENT-ID                   TOPIC(PARTITIONS)
consumer2-5d3a62da-abe1-427d-a9e9-4962c35f2dae-
my-other-topic    /127.0.0.1             0        consumer2  7902            8654     my-topic(1)
consumer3-ad71338d-d379-4cff-be2d-1e3971f32f51    /127.0.0.1     752        -        consumer3                   my-topic(2)
consumer1-5e864292-bef0-45f1-9b96-ea56943609e7     /127.0.0.1                 -    consumer1                   my-topic(0)

...

       -

–describe --

...

state

A new option The --partitions is introduced that is allowed state option, that can also be used with --describe only and for each topic partition the group has stored offset for it reports the current offset, log end offset, and the lag, reports the group level information that comes back in the response of DescribeGroups API call:

Code Block
languagebash
$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group --partitionsstate
Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers).
TOPICPROTOCOL:                          PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG
my-topic       range
PROTOCOL-TYPE: consumer
STATE:         Stable

--describe --subscription

The --subscription option is also a sub-option of --describe. It is used to extract subscription information of each member in the group. For each member, a comma-separated list of topics the member is subscribed to is returned:

Code Block
languagebash
$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group --subscription
Note: This will only show information about consumers that use the Java consumer API (non-ZooKeeper-based consumers).
CONSUMER-ID         1          30857           118320          87463
my-topic                       2    HOST      30857           118320          87463
myCLIENT-topicID              SUBSCRIPTION
consumer1-81fe8a2a-0b29-4964-a1d4-4741582132bb     /127.0.0.1    0          31357       consumer1    118320          86963
my-other-topic          my-topic
consumer2-db6f12f2-e1de-4bb7-93ec-6170fefa8830    /127.0.0.1   1          6895        consumer2    6895            0
my-other-topicmy-topic
consumer7-c1d056fa-eabc-42ed-b557-c848f747ec49    /127.0.0.1             0        consumer7  6894            6894            0my-second-topic

 

Compatibility, Deprecation, and Migration Plan

...