Skip to content

KafkaOffsetTool is a lightweight tool for Kafka offset operation and maintenance

License

Notifications You must be signed in to change notification settings

wl4g/kafka_offset_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KafkaOffsetTool is a lightweight tool for Kafka offset operation and maintenance

Build Status License

Quick start

Developer guide

  • a. Import to VSCode

  • b. Run -> Start Debugging

Compiling installation

./scripts/build.sh
./scripts/build.bat

Command Usages

  • All command help
./kafkaOffsetTool --help
  • Sub-command help.
./kafkaOffsetTool get-group --help
  • Get a list of consumer group.
./kafkaOffsetTool get-group
# or
./kafkaOffsetTool get-group --brokers=localhost:9092 --zkServers=localhost:2181 --type=kf --filter='(^spark\S+)'
  • Get a list of topics.
./kafkaOffsetTool get-topic
# or
./kafkaOffsetTool get-topic --brokers=localhost:9092 --zkServers=localhost:2181 --filter='(^elecpower\S+)'
  • Get a list of group consumer owner offset describe.
./kafkaOffsetTool get-offset
# or
./kafkaOffsetTool get-offset --brokers=localhost:9092 --zkServers=localhost:2181 --outputFile=myoffset.json --groupFilter='(^console\S+)' --topicFilter='(^elecpower\S+)'
  • Set the specified groupId, topic, and partition offset.
./kafkaOffsetTool set-offset --brokers=localhost:9092 --zkServers=localhost:2181 --resetGroup=myConsumerGroup1 --setTopic=mytopic1 --setPartition=0 --setOffset=100
# or, Set the specified groupId, topic, and partition offset from import file.
./kafkaOffsetTool set-offset --brokers=localhost:9092 --zkServers=localhost:2181 --inputFile=myoffset.json
  • Modify offset calculator tool.
./kafkaOffsetTool calc-offset -i myoffset.json -o myoffset2.json -I -0.1
#./kafkaOffsetTool calc-offset --inputFile myoffset.json --outputFile myoffset2.json --increment -0.1

Welcome reporting bugs

Contact author: <[email protected],[email protected]>