{
  "schema_version": 2,
  "id": "commands/ssubscribe",
  "title": "SSUBSCRIBE",
  "url": "https://redis.io/docs/latest/commands/ssubscribe/",
  "summary": "Listens for messages published to shard channels.",
  "since": "7.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T16:45:25+01:00",
  "page_type": "content",
  "content_hash": "0ce60c4acc5b5489f0f51406e3e539908fce263538f13343f3dd1b4411ec30d6",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Subscribes the client to the specified shard channels.\n\nIn 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.\n\nAll 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.\n\nFor more information about sharded Pub/Sub, see [Sharded Pub/Sub](https://redis.io/docs/latest/develop/pubsub#sharded-pubsub)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>shardchannel [shardchannel ...]</code></summary>\n\nOne or more shard channels to subscribe to.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "[code example]"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nWhen 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.\n\n**RESP3:**\n\nWhen 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."
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "> ssubscribe orders\nReading messages... (press Ctrl-C to quit)\n1) \"ssubscribe\"\n2) \"orders\"\n3) (integer) 1\n1) \"smessage\"\n2) \"orders\"\n3) \"hello\"",
      "section_id": "examples"
    }
  ]
}
