-
a. Import to VSCode
-
b. Run -> Start Debugging
./scripts/build.sh
./scripts/build.bat
- 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
Contact author: <[email protected],[email protected]>