This topic describes how to manage the consumer offset when a consumer stops consuming messages due to an exception.
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 depends on the consumer SDK that you use. Generally, the following two mechanisms are supported:
- Automatic committing: The SDK commits the consumer offset of the latest consumed message plus 1 at the specified intervals.
- Manual committing: You call the commit(offsets) function to commit the consumer offset of the latest consumed message plus 1 on the client.
To view consumer offsets in the console, go to the Groups page. Find the required consumer group and choose View consumption details.
in the Actions column. On the page that appears, view the consumer offset committed by the required consumer. The consumer continues the consumption from this consumer offset. For more information, seeYou can manually reset a consumer offset recorded by the broker in the console. You can move the offset backward for repeated consumption or move it forward to skip the consumption of specified messages.
Important To reset a consumer offset in the console, you must stop the consumer first. For more information, see Reset consumer offsets. Otherwise, the updated consumer offset may be overwritten by the consumer offset newly committed by the consumer.