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.
精彩评论