Redis Stream usage

41 views
Skip to first unread message

Kit Karson

unread,
Sep 22, 2021, 6:50:03 AMSep 22
to Redis DB
Dear Redis Team,

I would appreciate if you could answer this.

I am looking for suggestion/advice related to redis streams usage in production.

In pub/sub redis pushes the data to client directly. In Redis stream , looks like, the client has to constantly poll for new items.

I did read this - https://redis.io/topics/streams-intro#listening-for-new-items-with-xread

If I implement a consumer which is supposed to the process all the messages in more or less real time, Should I look for new items in an infinite loop with some BLOCK time. ? Is there any best practice for BLOCK time. For ex: 1 hour - is it good or bad? Does it have any impact on redis?

Thanks.

sundb

unread,
Sep 27, 2021, 2:15:07 AMSep 27
to Redis DB
If you wanna permanently listen for new messages, you can use `xread block 0`.
It does not have any effect to redis.
Reply all
Reply to author
Forward
0 new messages