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.
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.
Prerequisites
- A topic has been created.
- A consumer group has been created and there are consumers in the group.
Resetting Consumer Offset
- Log in to the RocketMQ console.
- Click a RocketMQ instance name to go to the instance overview page.
- In the navigation pane, choose Instance > Consumer Groups.
- Reset the consumer offset in either of the following ways:
- In the row containing the desired consumer group, click Reset Consumer Offset.
- Click the name of the desired consumer group to go to the consumer group details page. In the upper right corner of the page, click Reset Consumer Offset. The Reset Consumer Offset dialog box is displayed.
- 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.
- Click OK.
Messages may be consumed more than once after the offset is reset. Exercise caution when performing this operation.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.