Kafka consumers


Commands for updating consumer groups offsets.

Flags --group and --topic are mandatory and specify the consumer group ID and topic name respectively.

To affect all topics use the —all-topics flag.

FlagDescription
-g, --groupSet the Consumer Group ID
-t, --topicSet the topic name
--all-topicsSelect implicitly all the topics
--topicsThe topic to reset offsets for
--partitionSet the partition ID
--to-earliestReset partition offset to earliest offset
--to-latestReset partition offset to latest offset
--to-offsetReset the partition offset to the provided value

Update a single topic’s partition offset to the specified value 

lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-offset <offset_id>

Update to the earliest offset available 

lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-earliest

Update to the latest offset available 

lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-latest

Update given topics for all their partition offsets to the specified datetime 

lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-datetime <datetime>

Reset given topics for all their partitions offsets to the earliest offset possible 

lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-earliest

Reset given topics for all their partitions offsets to the latest offset possible 

lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-latest

Reset offsets for all topics of this consumer group 

lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --all-topics \
    --to-latest
--
Last modified: April 24, 2024