We are building an app that has to process messages from multiple streams in priority - at any point of time it should process the message from the Highest priority stream.
We tried using xreadgroup … count 1 streams s1 s2 s3 …, but realized that we will get up to 1 message from EACH stream. We hope to get 1 message from the first stream with data.
Looking for help/info:
- What is the use case for reading N messages from every stream ?
- Simple alternative to achieve the requested functionality is to iterate over the streams one at a time - is there a better solution ?
- Is this a good use case to use LUA. scripting to speed up the polling ?
- The BLPOP command provides the intended behavior, without the semantics of a stream. The drawback is that the stored item must be a string. Is this a good alternative (using JSON to store complex messages) ?
Thanks,
Dasho