You can reset consumer offsets to skip the accumulated or undesired messages and restart consumption. You can also consume messages after a specified point in time regardless of whether the messages before this point in time are consumed.

Considerations

  • You cannot reset consumer offsets in broadcasting consumption mode.
  • You cannot reset consumer offsets by specifying a message ID, message key, or tag.
  • In the ApsaraMQ for RocketMQ console, you can reset consumer offsets for only groups that are created over TCP.

Procedure

  1. Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.
  2. In the top navigation bar, select a region. Example: China (Hangzhou). Then, click the ID of the instance that you want to manage.
  3. In the left-side navigation pane, click Groups. Then, click the TCP tab.
  4. On the Groups page, click the TCP tab.
  5. Find the group for which you want to reset the consumer offset, click More in the Actions column, and then select Reset Consumer Offset. mq.reset_consumer_site
  6. In the Reset Consumer Offset panel, select one of the following options based on your business requirements, and click OK. mq.reset_consumer_site_talk
    Warning If you select Start Consumption from Latest Offset, all accumulated messages in the specified topic of the group are cleared. This operation takes effect after about 2 to 3 minutes. Do not repeat the operation. During the 2 to 3 minutes before which the operation takes effect, all consumers in the application stop consuming messages. Proceed with caution if your business is latency-sensitive.
    • If you select Start Consumption from Latest Offset, the consumers of the group skip all accumulated messages in the topic and start consumption from the latest offset.

      If reconsumeLater is returned, the messages that are being retried cannot be skipped.

    • If you select Start Consumption from Offset Corresponding to Specified Point in Time, a time picker appears. Select a point in time. Only the messages that are sent after the selected point in time are consumed.

      The period allowed for the time picker ranges from the production time of the earliest message stored in the topic to the production time of the latest message stored in the topic. Points in time that are not within the allowed time range are invalid.

Troubleshooting

  • What do I do if I failed to reset consumer offsets by using the preceding two methods?
    1. Check whether the clustering consumption mode is used. You cannot reset consumer offsets in broadcasting consumption mode.
    2. Check whether the current consumer is online. The consumer must be online before you can reset consumer offsets.
    3. Check the SDK version. This issue may also occur if the SDK version is outdated. We recommend that you upgrade the SDK to the latest version. For example, the version of the TCP client SDK for Java must be 1.8.0.Final or later. For more information, see Release notes.
  • Why are the consumer offsets for some messages are not reset after I reset consumer offsets to skip accumulated messages?

    The consumer offset reset feature does not take effect for messages in the retry process. Therefore, a small number of messages in the retry process are still delivered after you reset the consumer offsets.