eclipse-symphony / symphony

Symphony project
MIT License
34 stars 26 forks source link

Redis pubsub support multiple subscriber for one publisher #358

Open RemindD opened 1 month ago

RemindD commented 1 month ago

In https://github.com/eclipse-symphony/symphony/pull/339, all the consumer groups are using constant value RedisGroup = "symphony". As a result, if there are multiple subscribers for the same topic, they will compete for messages.

The fix is to set different consumer groups for different subscribers so that every message published to the topic can be processed by all subscribers. A simple idea is to change Subscribe interface to pass in a number. Note that the number should be deterministic so different symphony replicas will use the same consumer group.

msftcoderdjw commented 1 month ago

Current pubsub is implemented for one publisher and one subscriber (so the consumer group is fixed value). Only trail case is using multiple subscriber now. Considering future case, we need to fix this to pass consumer group.