如何在Apache Apisix中实现和配置断路?

发布于 2025-02-06 02:07:20 字数 33 浏览 1 评论 0原文

需要在当前环境中配置断路,因此如何在网关层实现断路?

Circuit breaking needs to be configured in the current environment, so how to implement the circuit breaking at the gateway layer?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泅人 2025-02-13 02:07:20

这是断路的示例:

curl "http://127.0.0.1:9180/apisix/admin/routes/1"  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "uri": "/hello",
    "plugins": {
        "api-breaker": {
            "break_response_code": 502,
            "unhealthy": {
                "http_statuses": [500, 503],
            },
        }
    },
    "upstream": {
        "nodes": {
            "httpbin.org:80": 1
        }
    }
}'

您可以阅读更多在这里

Here is an example of circuit breaking:

curl "http://127.0.0.1:9180/apisix/admin/routes/1"  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "uri": "/hello",
    "plugins": {
        "api-breaker": {
            "break_response_code": 502,
            "unhealthy": {
                "http_statuses": [500, 503],
            },
        }
    },
    "upstream": {
        "nodes": {
            "httpbin.org:80": 1
        }
    }
}'

You can read more here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文