Sharded pubsub publish messagebulk as smessage (#10792)
To easily distinguish between sharded channel message and a global channel message, introducing `smessage` (instead of `message`) as message bulk for sharded channel publish message. This is gonna be a breaking change in 7.0.1! Background: Sharded pubsub introduced in redis 7.0, but after the release we quickly realized that the fact that it's problematic that the client can't distinguish between normal (global) pubsub messages and sharded ones. This is important because the same connection can subscribe to both, but messages sent to one pubsub system are not propagated to the other (they're completely separate), so if one connection is used to subscribe to both, we need to assist the client library to know which message it got so it can forward it to the correct callback.
This commit is contained in:
@@ -11,7 +11,7 @@ start_server {tags {"modules"}} {
|
||||
assert_equal {1} [subscribe $rd2 {chan1}]
|
||||
assert_equal 1 [r publish.shard chan1 hello]
|
||||
assert_equal 1 [r publish.classic chan1 world]
|
||||
assert_equal {message chan1 hello} [$rd1 read]
|
||||
assert_equal {smessage chan1 hello} [$rd1 read]
|
||||
assert_equal {message chan1 world} [$rd2 read]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user