{
  "id": "callnext",
  "title": "CallNext",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnext/",
  "summary": "Calls the next execution that overrides the command or the original command itself. A more flexible version of callNextArray.",
  "tags": [
    "docs",
    "operate",
    "stack"
  ],
  "last_updated": "2026-04-22T11:55:45+02:00",
  "page_type": "content",
  "content_hash": "4b166ea163d12741a2d7f519535b140b65f3d1455a6a949cd1f01cd0b009bd09",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "[code example]\n\nWhen you override a Redis command with the [`CommandOverrider`](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/readers/commandoverrider), use `callNext` to run the next execution that overrides the command or the original command itself.\n\nIt is a more flexible version of [`callNextArray`](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callNextArray) since the list of string arguments does not have to be an explicit `String[]` object. This allows function calls like: <nobr>`callNext(\"key\", \"value\")`.</nobr>"
    },
    {
      "id": "parameters",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Name | Type | Description |\n|------|------|-------------|\n| args | string | Redis command arguments |"
    },
    {
      "id": "returns",
      "title": "Returns",
      "role": "returns",
      "text": "Returns the command result. It could be a string or an array of strings, depending on the command."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "Without `String[]`:\n\n[code example]\n\nWith `String[]`:\n\n[code example]"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "java",
      "code": "public static java.lang.Object callNext(java.lang.String... args)",
      "section_id": "overview"
    },
    {
      "id": "examples-ex0",
      "language": "java",
      "code": "GearsBuilder.callNext(\"restaurant:1\", \"reviews\", \"50\");",
      "section_id": "examples"
    },
    {
      "id": "examples-ex1",
      "language": "java",
      "code": "GearsBuilder.callNext(new String[]{\"restaurant:1\", \"reviews\", \"50\"});",
      "section_id": "examples"
    }
  ]
}
