Saving a consumer offset
Each topic consumer has a consumer offset.
You can use the topic consumer offset commit
command to save the consumer offset for the consumer that you added.
General format of the command:
ydb [global options...] topic consumer offset commit [options...] <topic-path>
global options
: Global parameters.options
: Parameters of the subcommand.topic-path
: Topic path.
Viewing the command description:
ydb topic consumer offset commit --help
Parameters of the subcommand
Name | Description |
---|---|
--consumer <value> |
Consumer name. |
--partition <value> |
Partition number. |
--offset <value> |
Offset value that you want to set. |
Examples
Note
The examples use the quickstart
profile. To learn more, see Creating a profile to connect to a test database.
For my-consumer
, set the offset of 123456789 in my-topic
and partition 1
:
ydb -p db1 topic consumer offset commit \
--consumer my-consumer \
--partition 1 \
--offset 123456789 \
my-topic