---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/reference/ydb-cli/topic-consumer-offset-commit.md?version=v25.3
  - https://ydb.tech/docs/ru/reference/ydb-cli/topic-consumer-offset-commit.md?version=v25.3
  - href: en/reference/ydb-cli/topic-consumer-offset-commit.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/reference/ydb-cli/topic-consumer-offset-commit.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Saving a consumer offset

Each topic consumer has a [consumer offset](https://ydb.tech/docs/en/concepts/datamodel/topic.md?version=v25.3#consumer-offset).

You can use the `topic consumer offset commit` command to save the consumer offset for the consumer that you [added](https://ydb.tech/docs/en/reference/ydb-cli/topic-consumer-add.md?version=v25.3).

General format of the command:

```bash
ydb [global options...] topic consumer offset commit [options...] <topic-path>
```

* `global options`: [Global parameters](https://ydb.tech/docs/en/reference/ydb-cli/commands/global-options.md?version=v25.3).
* `options`: [Parameters of the subcommand](#options).
* `topic-path`: Topic path.

Viewing the command description:

```bash
ydb topic consumer offset commit --help
```

## Parameters of the subcommand {#options}

| Name                  | Description                        |
|-----------------------|------------------------------------|
| `--consumer <value>`  | Consumer name.                     |
| `--partition <value>` | Partition number.                  |
| `--offset <value>`    | Offset value that you want to set. |

## Examples {#examples}

<!-- source: en/_includes/ydb-cli-profile.md -->
{% note info %}

The examples use the `quickstart` profile. To learn more, see [Creating a profile to connect to a test database](https://ydb.tech/docs/en/reference/ydb-cli/profile/create.md?version=v25.3#quickstart).

{% endnote %}
<!-- endsource: en/_includes/ydb-cli-profile.md -->

For `my-consumer`, set the offset of 123456789 in `my-topic` and partition `1`:

```bash
ydb -p db1 topic consumer offset commit \
  --consumer my-consumer \
  --partition 1 \
  --offset 123456789 \
  my-topic
```
