GetOffsetShell Utility is a standalone application that is used to get offsets of the partitions of a topic.

GetOffsetShell can be executed using kafka-run-class shell script.

./bin/ \
  --broker-list :9092 \
  --topic t1
// topicName:partitionID:offset

When executed with no options, it is equivalent to --help.

Table 1. Options
Option Description


(required) The comma-separated list of brokers to connect to (e.g. hostname:port,…​,hostname:port)


The comma-separated list of partition IDs

If not specified (empty), it will find offsets for all partitions

Default: (empty)


Timestamp of the offsets before that.

No offset is returned, if the timestamp is greater than recently commited record timestamp

Possible values:

  • a timestamp

  • -1 (LATEST_TIMESTAMP) for the first offsets

  • -2 (EARLIEST_TIMESTAMP) for the end offsets

Default: -1


(required) Topic to get offsets from

GetOffsetShell is a Kafka consumer with GetOffsetShell client ID.

Executing Standalone Application — main Method

main(args: Array[String]): Unit

main is the entry point of the GetOffsetShell standalone application when launched on command line (e.g. from bin/

Internally, main…​FIXME

results matching ""

    No results matching ""