SSUBSCRIBE
SSUBSCRIBE shardchannel [shardchannel ...]
No method signature available for this client.
No method signature available for this client.
No method signature available for this client.
No method signature available for this client.
No method signature available for this client.
No method signature available for this client.
No method signature available for this client.
No method signature available for this client.
No method signature available for this client.
ssubscribe(
$shardChannels: string... // Shard channels to subscribe to
) → array // Subscription confirmation messages
No method signature available for this client.
No method signature available for this client.
- Available since:
- Redis Open Source 7.0.0
- Time complexity:
- O(N) where N is the number of shard channels to subscribe to.
- ACL categories:
-
@pubsub,@slow, - Compatibility:
- Redis Software and Redis Cloud compatibility
Subscribes the client to the specified shard channels.
In Redis Cluster, shard channels are assigned to slots with the same algorithm Redis uses to assign keys to slots. To receive messages published to a shard channel, subscribe to a node, either a primary or replica, that serves the channel’s slot.
All shard channels in a single SSUBSCRIBE call must belong to the same slot. To subscribe to shard channels across different slots, use separate SSUBSCRIBE calls.
For more information about sharded Pub/Sub, see Sharded Pub/Sub.
Required arguments
Examples
> ssubscribe orders
Reading messages... (press Ctrl-C to quit)
1) "ssubscribe"
2) "orders"
3) (integer) 1
1) "smessage"
2) "orders"
3) "hello"
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Return information
ssubscribe is pushed as a confirmation that the command succeeded. Note that this command can also return a -MOVED redirect.
