If you reset a consumer offset, the offset from which a consumer starts to consume messages is changed. You can reset a consumer offset to clear the accumulated or unwanted messages as needed or start to consume messages from a specific point in time.
Prerequisites
Notice After you stop a consumer, the Message Queue for Apache Kafka broker considers the
consumer stopped after the period of time specified by the
ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG
parameter elapses. The default value of this parameter is 10000, in milliseconds.
Background information
Message Queue for Apache Kafka allows you to reset consumer offsets in one of the following ways:
- Clear messages: If you no longer want to consume accumulated messages on the broker,
you can clear messages for the consumer. This way, the consumer offset is set to the
latest offset.
Notice Accumulated messages are not deleted. Only the consumer offset is changed.
- Start consumption at a specified point in time: You can reset the consumer offset of a group to a point in time "t" that is in the past or future. "t" indicates a point in time when a message is stored. Then, the group starts to consume messages stored after "t".
- Start consumption at a specified offset in a partition: You can reset the consumer offset of a group to "3" in partition "1". "1" indicates a partition of the topic to which the group subscribes. "3" indicates the offset of a message in the partition. Then, the group starts to consume messages from offset "3" in partition "1".
Procedure
- Log on to the Message Queue for Apache Kafka console.
- In the Resource Distribution section of the Overview page, select the region where your instance resides.
- On the Instances page, click the name of the instance that you want to manage.
- In the left-side navigation pane, click Groups.
- On the Groups page, find the group for which you want to reset the consumer offset, click in the Actions column, and then select Reset Consumer Offset.
- In the Reset Consumer Offset of Group panel that appears, read the prerequisites and configure the reset policy.Prerequisites
- In the Note message, read the note. If you are sure to reset the consumer offset, click OK.