...
ID | Scenario | Arguments | Considerations |
---|---|---|---|
1. | Reset to Timestamp | --to-datetime YYYY-MM-DDTHH:mm:SS.sss | This option will translate the datetime to Epoch milliseconds, find the offsets by timestamp, and reset to those offsets. It will use the datetime specified plus the default timezone where the client is running (i.e. ZoneId#systemDefault) |
2. | Reset to Duration | --to-duration PnDTnHnMnS | This option will subtract the duration to the current timestamp in the server, and find the offsets using that subtracted timestamp, and reset to those offsets. The duration specified won't consider daylight saving effects. |
3. | Reset to Earliest | --to-earliest | This option will reset offsets to the earliest using Kafka Consumer's `#seekToBeginning` |
4. | Reset to Latest | --to-latest | This option will reset offsets to the earliest using Kafka Consumer's `#seekToEnd` |
5. | Reset to Current Position | (no scenario arguments) | This option won't reset the offset. It will be used to print and export current offset. |
6. | Reset to Offset | --to-offset | This option will reset offsets to an specific value. |
7. | Shift Offset by 'n' | --shift-offset-by n | This option will add the `n` value to the current offset, and reset to the result. `n` can be a positive or negative value, so offset will be move backward if it is negative, and forward if it is positive. If current offset + n is higher than the latest offset, new offset will be set to latest. If current offset + n is lower than the earliest offset, new offset will be set to earliest. |
8 | Reset from File | --reset-from-file PATH_TO_FILE | This option will take a Reset Plan CSV file with the offsets to reset by topics/partitions. |
Scopes
...
The scopes will be defined extending the existing `topic` argument, using the following format:
Code Block |
---|
--topic <topic-name>:<partition numbers>
ex: --topic topic1 --topic topic2:0,1,2 |
ID | Scope | Arguments | Description | ||||
---|---|---|---|---|---|---|---|
1. | All topics | --all-topics | In this case the tool will run the scenario considering all topics that has been consumed by Consumer Group. It will consider all partitions by topic assigned. | ||||
2. | List of Topics | --topicstopic topic1 ,topic2...--topic topic2 | In this case, the tool first will validate that input topics are been consumed by Consumer Group, and then run the scenario. It will consider all partitions by topic defined. | ||||
3. | TopicTopics and List of Partitions | --topic topic1:0,1,2 --topic topic2:0 | In this case, the tool first will validate that input topic is been consumed by Consumer Group, and then run the scenario. It will consider | all partitionsonly the partitions specified by topic. | |||
4. | Topic | and List of Partitions--topic topic1 | --partitions 0,1,2In this case, the tool first will validate that input topic is been consumed by Consumer Group, and then run the scenario. It will consider | only theall partitions | specified. |
Execution Options
ID | Option | Arguments | Description |
---|---|---|---|
1. | Plan | (no execution arguments) | This execution option will only print out the result of the scenario by scope. The output will look like this: TOPIC PARTITION CURRENT-OFFSET NEW-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID |
2. | Execute | --execute | This execution option will run the reset offset process based on scenario and scope. |
3. | Export | --export | This execution option will print out the reset plan in CSV format, that later could be used in the scenario 8. (i.e. as backup) |
...