Updated on 2025-07-28 GMT+08:00

Resetting the RocketMQ Consumer Offset

Resetting the RocketMQ consumer offset modifies the consumer position. Consumers consume messages from the modified positions.

Context

RocketMQ manages message consumption progress with a consumer offset. Each message is not deleted from the queue immediately after being consumed. RocketMQ maintains a consumption record for each consumer group. This record specifies the offset of the latest consumed message when a consumer in the consumer group consumes a specified topic. When a consumer client goes offline and then online again, the consumer continues processing messages based on the consumer offset stored on the server.

To re-consume or skip some messages, adjust the consumption progress by resetting the consumer offset.

Video Tutorial

This video shows how to reset the RocketMQ consumer offset.

Notes and Constraints

  • The consumer offset from a specific consumer group to a target topic can be reset. The consumption progress of other subscribers to this topic is not affected.
  • Unavailable in broadcast mode.
  • Only for accessible messages but not for scheduled and retried messages.
  • Available only when the consumer is online.

Prerequisites

  • A RocketMQ instance has been purchased.
  • A topic has been created.
  • A consumer group has been created and there are consumers in the group.

Procedure

  1. Log in to the console.
  2. Click in the upper left corner to select a region.

    DMS for RocketMQ instances in different regions cannot communicate with each other over an intranet. Select a nearest location for low latency and fast access.

  3. Click and choose Middleware > Distributed Message Service for RocketMQ to open the console of DMS for RocketMQ.
  4. Click a RocketMQ instance to go to the instance details page.
  5. In the navigation pane, choose Instance > Consumer Groups.
  6. In the row containing the desired consumer group, click Reset Consumer Offset.
  7. Set parameters by referring to Table 1.

    Table 1 Parameters for resetting the consumer offset

    Parameter

    Description

    Topic Name

    Select the topic whose consumer offset is to be reset.

    Time

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

    • Custom: Message consumption restarts from the customized time.
    • Earliest: Message consumption starts from the earliest time.
    • Latest: Message consumption starts from the latest time. The messages before this time will not be consumed.

  8. Click OK.

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

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

Related Document

To reset the consumer offset by calling an API, see Resetting the Consumer Offset.