{
  "schema_version": 2,
  "id": "commands/xgroup-createconsumer",
  "title": "XGROUP CREATECONSUMER",
  "url": "https://redis.io/docs/latest/commands/xgroup-createconsumer/",
  "summary": "Creates a consumer in a consumer group.",
  "since": "6.2.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": "1c54866b33c9697a43d8078028d3edb722223d18a4d315b013d913597e64a62e",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Create a consumer named `consumername` in the consumer group `groupname` of the stream that's stored at `key`.\n\nConsumers are also created automatically whenever an operation, such as [`XREADGROUP`](https://redis.io/docs/latest/commands/xreadgroup), references a consumer that doesn't exist.\nThis is valid for [`XREADGROUP`](https://redis.io/docs/latest/commands/xreadgroup) only when there is data in the stream."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe stream key.\n\n</details>\n\n<details open><summary><code>group</code></summary>\n\nThe consumer group name.\n\n</details>\n\n<details open><summary><code>consumer</code></summary>\n\nThe name of the consumer to create.\n\n</details>"
    },
    {
      "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\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of created consumers, either 0 or 1.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of created consumers, either 0 or 1."
    }
  ],
  "examples": []
}
