Resetting the Consumer Offset

Resetting the consumer offset is to change the retrieval position of a consumer.

Important

Messages may be retrieved more than once after the offset is reset. Exercise caution when performing this operation.

Prerequisites

The consumer offset cannot be reset on the fly. You must first stop retrieval of the desired consumer group.

Procedure

  1. Log in to the management console.

  2. Click image1 in the upper left corner to select a region.

    Note

    Select the region where your Kafka instance is located.

  3. Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.

  4. Click the desired Kafka instance to view the instance details.

  5. In the navigation pane, choose the Consumer Groups tab.

  6. Click the name of the desired consumer group.

  7. On the Consumer Offset tab page, you can perform the following operations:

    • To reset the consumer offset of all partitions of a topic, click Reset Consumer Offset in the row containing the desired topic.

    • To reset the consumer offset of a single partition of a topic, click Reset Consumer Offset in the row containing the desired partition.

  8. In the displayed Reset Consumer Offset dialog box, set the parameters by referring to Table 1.

    Table 1 Parameters for resetting the consumer offset

    Parameter

    Description

    Reset By

    You can reset an offset by:

    • Time: Reset the offset to the specified time.

    • Offset: Reset the offset to the specified position.

    Time

    Set this parameter if Reset By is set to Time.

    Select a time point. After the reset is complete, retrieval starts from this time point.

    • Earliest: earliest offset

    • Custom Time Range: a custom time point

    • Latest: latest offset

    Offset

    Set this parameter if Reset By is set to Offset.

    Enter an offset, which is greater than or equal to 0. After the reset is complete, retrieval starts from this offset.

  9. Click OK.

  10. Click Yes in the confirmation dialog box. The consumer offset is reset.