This topic describes how to manage the consumer offset when a consumer stops consuming messages due to an exception.
Commission mechanisms of consumer offsets
The consumer offset is not necessarily committed after a message is consumed. The broker records the consumer offset committed by the consumer.
The mechanism used to commit consumer offsets varies based on the client SDK that you use. In most cases, the following mechanisms are supported:
Automatic commission: The SDK commits the consumer offset of the latest consumed message plus 1 at a specific interval.
Manual commission: You call the commit(offsets) function to commit the consumer offset of the latest consumed message plus 1 on the client.
Procedure
View the consumer offset
On the Subscriptions tab of the Topic Details page, click Consumer Details in the Actions column of the topic that you want to manage. In the panel that appears, view the consumer offset committed by the required consumer. The consumer continues consumption from this consumer offset. For more information, see View consumer details.
Reset the consumer offset
In the upper-right corner of the Group Details page, click Reset Consumer Offset. In the Reset Consumer Offset panel, select a method to reset the consumer offset. For more information, see Reset consumer offsets.
ImportantBefore you reset the consumer offset of a consumer group in the ApsaraMQ for Kafka console, you must stop the consumer. Otherwise, the updated consumer offset may be overwritten by the new consumer offset committed by the consumer.