All Products
Search
Document Center

ApsaraMQ for Kafka:Reset consumer offsets

Last Updated:Jul 09, 2026

Reset a consumer offset to re-consume messages from an earlier position or a specific partition offset, or skip to the latest position to bypass message backlog.

Prerequisites

Stop all consumer clients. ApsaraMQ for Kafka does not support resetting offsets for active consumers.

Important

After you stop a consumer client, the broker considers it offline only after the ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG period elapses (default: 10,000 ms).

Background information

ApsaraMQ for Kafka supports the following reset methods:

  • Start consuming from the latest offset: Resets the offset to the latest position, skipping any message backlog.

  • Start consuming from a specified point in time: Resets the offset to a past timestamp based on when messages were stored. As long as messages remain within Kafka's retention period (default: 3 days), selecting this option guarantees that all messages from the specified timestamp onward are re-consumed without being missed.

    Note

    Before resetting the offset, stop all consumer clients and wait for the ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG period (default: 10,000 ms) to elapse. This ensures the broker recognizes all consumers as offline before the reset takes effect.

  • Reset consumer offsets by partition: Resets offsets for specific partitions only, avoiding re-consumption of correctly processed messages in other partitions.

Note

This operation only changes the consumer offset. It does not delete backlog messages.

Procedure

  1. Log on to the ApsaraMQ for Kafka console.

  2. In the Resource Distribution section of the Overview page, select the region where the ApsaraMQ for Kafka instance that you want to manage resides.

  3. On the Instances page, click the name of the instance that you want to manage.

  4. In the left-side navigation pane, click Groups.

  5. On the Groups page, click the target Group ID.

  6. On the Group Details page, click Reset Consumer Offset.

  7. On the Reset Consumer Offset for Group panel, review the Prerequisites and set the reset policy.

    1. Configure Reset All Topics.

      • Click Yes to reset the consumer offsets for all topics.

      • Click No and enter the name of the topic to reset in the Topic text box.

    2. Configure Reset Method.

      • Click Reset Consumer Offset to Latest Offset, and then click OK.

      • Click Reset Consumer Offset to Offset at Specified Point in Time. In the Point in Time field, click the Calendar calendar icon and select a time to start consumption. Then, click OK.

      • Click Reset Consumer Offsets by Partition. In the row for the target partition, enter the starting offset in the Consumer Offset text box, and then click OK.

  8. In the Note dialog box, confirm the information and click OK.

FAQ

Can resetting consumer offsets resolve partial topic consumption failures?

Resetting consumer offsets may help alleviate some cases of partial topic consumption failures. However, before proceeding, investigate whether the issue is caused by frequent rebalances or abnormal partition assignment.

  • If frequent rebalances are occurring, check the Kafka client version and adjust the session.timeout.ms and max.poll.interval.ms parameters to values appropriate for your consumption workload.

  • Confirm that the consumer group has correctly subscribed to the target topic.

If the root cause is confirmed to be abnormal partition assignment, resetting the consumer offset allows the consumer group to re-consume messages from the correct position.

Can I continue consuming after changing the Kafka consumer group ID?

Yes. After you change the consumer group ID, the new consumer group can continue consuming. However, the starting offset depends on whether the new consumer group is starting for the first time and the current state of the topic. Before switching consumer group IDs, first investigate the root cause of any issues, such as network problems or heartbeat timeout, to avoid the new consumer group encountering similar problems.

Will deleting a Kafka consumer group also delete its subscribed topics?

No. Consumer groups and topics are independent resources in ApsaraMQ for Kafka. Deleting a consumer group only removes the consumer group and its consumer offsets. The data and configuration of the subscribed topics are not affected.

How does a spark-kafka-source or Lindorm-Spark type consumer group submit consumer offsets?

  • spark-kafka-source: This consumer group type supports submitting consumer offsets to Kafka. You can control automatic offset submission by setting the enable.auto.commit parameter. Alternatively, set enable.auto.commit to false and manually call the commit(offsets) function to submit offsets at the appropriate time.

  • Lindorm-Spark: When using Lindorm-Spark to consume Kafka messages, submit offsets manually. Set enable.auto.commit to false and call commit(offsets) after the consumption logic completes. This ensures that offsets are submitted only after message processing is finished, preventing offset jumps or false monitoring alarms caused by automatic submission.

Related documents