-
Notifications
You must be signed in to change notification settings - Fork 90
Compute start and end offsets from timestamps #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 14 commits
225d5c0
009d23c
5681153
d8062f0
7ea4c68
48e2c33
6f46f16
f834a37
893fe01
8370eef
4f6ecc5
14ec8fb
eeda909
3a23b99
971140f
cbfb30c
2328ebd
8768512
dc6a694
ccd27d3
8d682e1
de1a0d1
ab6c8e0
33c36a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,6 +332,18 @@ The consumer can be stopped when the latest offset is reached using `--exit` par | |
kafkactl consume my-topic --from-beginning --exit | ||
``` | ||
|
||
The consumer can compute the offset it starts from using a timestamp : | ||
faillefer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
```bash | ||
kafkactl consume my-topic --from-timestamp <timestamp-with-milliseconds> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when reading I would like to have it as intuitive as possible. So I would suggest to change the parameter from an
|
||
``` | ||
**NOTE:** `--from-timestamp` is not designed to schedule the beginning of consumer's consumption. The offset corresponding to the timestamp is computed at the begininng of the process. So if you set it to a date in the future, the consumer will start from the latest offset. | ||
|
||
The consumer can be stopped when the offset corresponding to a particuliar timestamp is reached : | ||
faillefer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
```bash | ||
kafkactl consume my-topic --from-timestamp <timestamp-with-milliseconds> --to-timestamp <timestamp-with-milliseconds> | ||
``` | ||
**NOTE:** `--to-timestamp` is not designed to schedule the end of consumer's consumption. The offset corresponding to the timestamp is computed at the begininng of the process. So if you set it to a date in the future, the consumer will stop to the current latest offset. | ||
faillefer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The following example prints keys in hex and values in base64: | ||
```bash | ||
kafkactl consume my-topic --print-keys --key-encoding=hex --value-encoding=base64 | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,3 +17,15 @@ func ContainsInt32(list []int32, element int32) bool { | |||||
} | ||||||
return false | ||||||
} | ||||||
|
||||||
func StrArrayEqual(a, b []string) bool { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if len(a) != len(b) { | ||||||
return false | ||||||
} | ||||||
for i, v := range a { | ||||||
if v != b[i] { | ||||||
return false | ||||||
} | ||||||
} | ||||||
return true | ||||||
} |
Uh oh!
There was an error while loading. Please reload this page.