Problem
When you use Alibaba Cloud ApsaraMQ for Kafka, you receive alerts about message accumulation even after a Group is deleted.
Possible causes
You may receive alerts about message accumulation for the following reasons:
In server-side Kafka version 0.10.2, open source Apache Kafka does not provide a Kafka API to delete Groups and consumer offsets. Deleting a Group only logically removes it from the console. The actual server-side information, such as consumer offsets, is not deleted. The alerting system checks message offsets. As a result, you continue to receive alerts.
After you delete a Group, the consumer threads may not stop or a rebalancing may not occur. If this happens, the threads continue to consume messages. This can also trigger message accumulation alerts.
Solutions
To stop receiving message accumulation alerts after deleting a Group, perform the following operations:
Check the server-side version and perform the corresponding operations:
For versions 2.2.0 and later, perform the following operations:
If the Group has no active consumer threads, delete the Group directly. An active consumer thread is one that subscribes to messages using the `subscribe` method. If you still receive alerts after deleting the Group, check if any consumer threads are still committing consumer offsets.
Make sure the Group exists, then disconnect all consumer threads. In the console, reset the consumer offset to 0 for partitions where you want to stop tracking message accumulation. The system will then stop tracking accumulation for these partitions. For more information, see Reset consumer offsets.
For versions earlier than 2.2.0, perform one of the following operations:
Wait for the offsets to expire. The offsets expire after the configured consumer offset retention period. You cannot delete consumer offsets directly because the corresponding open source Apache Kafka version does not provide an interface for this operation. An offset is automatically cleared if it is not updated within its retention period. For more information about how to configure the consumer offset retention period, see Change message configurations.
If you cannot wait for the consumer offsets to expire, make sure the Group exists and disconnect all consumer threads. Then, in the console, reset the consumer offset to 0 for partitions where you want to stop tracking message accumulation. The system will then stop tracking accumulation for these partitions. For more information, see Reset consumer offsets.
If the Group has no active consumer threads, upgrade the server-side version to 2.2.0 or later. Then, recreate the Group and delete it again. For more information about how to upgrade the server-side version, see Upgrade instance versions.
NoteIn versions 2.2.0 and later, as long as a Group contains at least one active consumer thread, its consumer offsets will not be deleted, even if they exceed the consumer offset retention period. For more information, see Why are consumer offsets not deleted after they expire?.
If these methods do not solve the problem, you can disable monitoring and alerting for message accumulation. For more information about how to disable alert rules for message accumulation, see Cloud Monitor.