VOOZH about

URL: https://redis.io/docs/latest/commands/ssubscribe/

⇱ SSUBSCRIBE | Docs


{"acl_categories":["@pubsub","@slow"],"arguments":[{"display_text":"shardchannel","multiple":true,"name":"shardchannel","type":"string"}],"arity":-2,"categories":["docs","develop","stack","oss","rs","rc","oss","kubernetes","clients"],"command_flags":["pubsub","noscript","loading","stale"],"complexity":"O(N) where N is the number of shard channels to subscribe to.","description":"Listens for messages published to shard channels.","duplicateOf":"head:data-ai-metadata","group":"pubsub","key_specs":[{"begin_search":{"spec":{"index":1},"type":"index"},"find_keys":{"spec":{"keystep":1,"lastkey":-1,"limit":0},"type":"range"},"not_key":true}],"location":"body","since":"7.0.0","syntax_fmt":"SSUBSCRIBE shardchannel [shardchannel ...]","title":"SSUBSCRIBE","tableOfContents":{"sections":[{"id":"required-arguments","title":"Required arguments"},{"id":"examples","title":"Examples"},{"id":"redis-software-and-redis-cloud-compatibility","title":"Redis Software and Redis Cloud compatibility"},{"id":"return-information","title":"Return information"}]},"codeExamples":[]}

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

When successful, this command doesn't return anything. Instead, for each shard channel, one message with the first element being the string ssubscribe is pushed as a confirmation that the command succeeded. Note that this command can also return a -MOVED redirect.
When successful, this command doesn't return anything. Instead, for each shard channel, one message with the first element being the string 'ssubscribe' is pushed as a confirmation that the command succeeded. Note that this command can also return a -MOVED redirect.