Issue in Load Balancing between Healthy and Failure hosts

3 views
Skip to first unread message

Nithya Ravindran

unread,
Oct 27, 2025, 6:54:23 AMOct 27
to KrakenD Community
I am using krakend CE v2.11.0, I am trying to loadbalance between 2 different backend host with the same endpoint. The requests get routed between the hosts properly. But when i try to stop one host and try, I still get the failed response from the failure host rather than krakend calling the healthy host.

{
      "endpoint": "/api/doctors-list/",
      "method": "GET",
      "output_encoding": "no-op",
      "backend": [
        {
      "url_pattern": "/himes/api/doctors",
      "method": "GET",
      "encoding": "no-op",
      "host": [
        "http://192.168.20.152:782",
        "http://192.168.20.10:782"
      ],
      "extra_config": {
        "modifier/lua-proxy": {
          "allow_open_libs": true,
          "live": true,
          "post": "logToDb(request.load(), response.load());",
          "sources": ["./lua/trace_inject.lua", "./lua/log_to_db.lua"]
        }
      }
    }
      ],
      "input_query_strings": [
        "LocationID",
        "webServicekey"
      ],
      "input_headers": [
        "*"
      ],
      "extra_config": {
        "qos/http-cache": {
                    "shared": true
                },
        "documentation/openapi": {
          "description": "Get Doctors List for the facility/branch",
          "parameters": [
            {
              "description": "Branch Code",
              "in": "query_string",
              "name": "LocationID",
              "required": true,
              "type": "string"
            },
            {
              "description": "API Key for the client/build",
              "in": "query_string",
              "name": "webServicekey",
              "required": true,
              "type": "string"
            }
          ],
          "summary": "Get Doctors List for the facility/branch",
          "tags": [
            "Okadoc"
          ]
        },
        "modifier/lua-proxy": {
          "allow_open_libs": true,
          "live": true,
          "pre": "inject_endpoint_header();",
          "sources": [
            "./lua/inject_endpoint_header.lua"
          ]
        }
      }
    }
Reply all
Reply to author
Forward
0 new messages