CAP icon indicating copy to clipboard operation
CAP copied to clipboard

How to delete the message from redis stream after successfully consumed

Open zdz72113 opened this issue 4 years ago • 6 comments

Messages in redis stream will not be automatically deleted. Even if the consumption is successful, the memory will always increase.

zdz72113 avatar Jun 03 '22 02:06 zdz72113

Do you mean client-side messages? After the message is processed successfully, Acknowledg will be performed to the Redis Server.

For memory issues, please refer to https://github.com/dotnetcore/CAP/issues/927#issuecomment-875463076

yang-xiaodong avatar Jun 04 '22 03:06 yang-xiaodong

Do you mean client-side messages? After the message is processed successfully, Acknowledg will be performed to the Redis Server.

For memory issues, please refer to #927 (comment)

你好,我是选了Redis Stream做传输通道。测试当中发现,传输的消息已经被成功订阅和处理了,但在Redis Server里面一直不会被删除,这样会导致Redis Server里面的数据越来越多。有没有办法或配置当消息成功订阅后立即删除Redis Stream对应的消息。

zdz72113 avatar Jun 05 '22 00:06 zdz72113

The consumer cannot issue a delete instruction to the Stream Server after the execution is successful, because there may be other groups that have not performed Ack.

Regarding the Cleanup strategy of Redis Streams Log, which requires Redis support it, see the issue below for more information:
https://github.com/redis/redis/issues/5774

yang-xiaodong avatar Jun 08 '22 01:06 yang-xiaodong

https://redis.io/commands/xdel/

a34546 avatar Jul 07 '22 10:07 a34546

@zdz72113 你好,请问你时怎么处理这个问题得呢

zhangkeyuan avatar Jul 24 '24 02:07 zhangkeyuan

https://redis.io/commands/xdel/

是需要自己写个后台任务去定时清理吗

zhangkeyuan avatar Jul 24 '24 03:07 zhangkeyuan