GetOffsetShell Utility

kafka.tools.GetOffsetShell 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/kafka-run-class.sh kafka.tools.GetOffsetShell \
  --broker-list :9092 \
  --topic t1
// topicName:partitionID:offset
t1:0:0

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

Table 1. Options
Option Description

broker-list

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

partitions

The comma-separated list of partition IDs

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

Default: (empty)

time

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

topic

(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/kafka-configs.sh).

Internally, main…​FIXME

results matching ""

    No results matching ""