A subscription represents a specific consumer and its subscription to a topic. A consumer can consume all messages in a topic after subscribing to it. CKafka's subscription service provides the feature of saving the consumption offset on the server. This document describes how to add a subscription and reset the consumption offset in the CKafka console.
Adding a subscription
Setting an offset
In scenarios such as offline data processing, sometimes it is necessary to reset the offset to consume message history.
1. In the Topic List, click the target topic ID to enter the topic's Basic Info page.
2. Select the Subscription tab at the top and click Offset Settings in the Operation column of the target subscription.
3. In the Offset Settings window, select Topic or Partition as the dimension of settings and click Next.
Set based on Topic: It is suitable for scenarios such as batch resetting of consumption offsets and setting consumption offsets according to businesses.
Set based on Partition: It is suitable for setting consumption offset for each partition after knowing the consumption situation of each Partition.
4. Select the topic or partition for which to reset the offset (if no topic is selected, the offset will be reset for all topics by default) and click Next.
The offset value should be between the minimum offset and the maximum offset. If it is configured to be smaller than the minimum offset, the consumption will start from the minimum offset; if it is larger than the maximum offset, the consumption will start from the maximum offset.
Make sure that there are no consumers in a consumer group before resetting the group.
Viewing consumer details
On the subscription list page, click View Consumer Details in the Operation column to view the information of consumers in the consumer group and the relationship between a consumer and the topic subscribed to by the consumer.
On the subscription list page, click the small triangle on the left of a consumer group name to display the information of the topic subscribed to by the consumer group, including topic name, number of partitions, submitted offset position, maximum offset position, and number of unconsumed messages.
Click View Details in the Operation column to view offset consumption at the partition level.
As the offset information is maintained on the consumer side, the offset position is subject to the way the consumer submits the offset. It is displayed asynchronously and does not necessarily represent real-time consumption conditions.
Deleting a subscription
In the subscription list, click Delete in the Operation column of the target consumer and click OK to delete the consumer.
After you delete the consumer group, when the consumers in it re-establish connections for consumption, the offset will be reset, and consumption will start from the beginning.