开发者

redis pub sub and ttl

开发者 https://www.devze.com 2023-04-12 16:38 出处:网络
Is there a way so that I expire a \"published\" message in redis? I need this because, as per my understanding, any published message will be put in a queue till there is a subscriber. In such a case

Is there a way so that I expire a "published" message in redis?

I need this because, as per my understanding, any published message will be put in a queue till there is a subscriber. In such a case if there is no subscriber, I am storing the data ev开发者_如何转开发en after it may have become useless.


Published message never store in redis. Redis PUB/SUB


One more thing to think about is: you can always add a timestamp inside your messages' string representation. Then, even if a consumer gets a message but doesn't process it on time, it can ignore it.

Also, as Ganesh mentioned the pubsub queue doesn't store messages.

0

精彩评论

暂无评论...
验证码 换一张
取 消