You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/07/27 08:23:24 UTC

[GitHub] [apisix-website] guoqqqi commented on a change in pull request #429: docs: added 2021-07-27-use-of-plugin-orchestration-in-Apache-APISIX blog

guoqqqi commented on a change in pull request #429:
URL: https://github.com/apache/apisix-website/pull/429#discussion_r677229825



##########
File path: website/blog/2021-07-27-use-of-plugin-orchestration-in-Apache-APISIX.md
##########
@@ -0,0 +1,184 @@
+---
+title: "插件编排在 Apache APISIX 中的应用与实践"
+author: juzhiyuan
+authorURL: "https://github.com/juzhiyuan"
+authorImageURL: "https://avatars.githubusercontent.com/u/2106987?v=4"
+---
+> [@juzhiyuan](https://github.com/juzhiyuan), Apache APISIX PMC from [Shenzhen Zhiliu Technology Co.](https://www.apiseven.com/)
+<!--truncate-->
+
+本文作者琚致远,为 Apache APISIX PMC,在支流科技负责企业产品与大前端技术。通过阅读本文,您可以了解 Apache APISIX 与基本使用场景,以及在低代码潮流下,Apache APISIX 是如何集成“拖拽”的插件编排能力的。
+
+## 什么是 Apache APISIX
+
+Apache APISIX 是一个生产可用的七层全流量处理平台,可作为 API 网关处理业务入口流量,具有极高性能、超低延迟的显著特性。它内置了 50 多种插件,覆盖身份验证、安全防护、流量控制、Serverless、可观测性等多个方面,可满足企业客户常见的使用场景。
+
+如下方架构图所示,Apache APISIX 分为数据面(左侧)与控制面(右侧)两部分:通过控制面下发配置到 ETCD,数据面借助丰富的插件处理内外流量。
+
+![2021-07-27-1](../static/img/blog_img/2021-07-27-1.png)
+
+Apache APISIX 暴露了一组接口,方便我们为 API 绑定插件。如果我们希望为 API 增加限速能力,只需为 API 绑定 `limit-req` 插件:
+
+``` shell
+curl -X PUT http://127.0.0.1:9080/apisix/admin/routes/1 -d '
+
+ {
+   "uri": "/get",
+   "methods": ["GET"],
+   "upstream": {
+     "type": "roundrobin",
+     "nodes": {
+       "httpbin.org:80": 1
+     }
+   },
+   "plugins": {
+     "limit-req": {
+       "rate": 1,
+       "burst": 2,
+       "rejected_code": 503,
+       "key": "remote_addr"
+     }
+   }
+ }
+```
+
+调用成功后,当请求到达该 API 时将进行限速管控。
+
+该示例使用 `limit-req` 实现 API 限速(特定功能),若针对“根据某个插件的处理结果,决定后续的请求处理逻辑”这种场景化需求,该怎么做呢?当前,现有的插件机制无法满足这种需求,这时便引申出插件编排的能力来解决这个问题。
+
+## 什么是插件编排
+
+插件编排是低代码的一种表现形式,它可以帮助企业降低使用成本、增加运维效率,是企业数字化转型过程中不可或缺的能力。借助低代码 API 网关 Apache APISIX 中插件编排能力,我们可以轻松地将 50+ 插件通过“拖拽”的方式进行组合编排,被编排的插件也能够共享上下文信息,最终实现场景化需求。
+
+扩展上述 API 限速的场景:请求使用 `key-auth`插件进行身份认证,若认证通过,将由`kafka-logger` 插件接管并进行日志记录;若认证失败(插件返回 401 状态码),将使用`limit-req` 插件进行限速。
+
+见如下操作视频:
+
+<iframe
+    height="350"
+    width="600"

Review comment:
       ```suggestion
       width="100%"
   ```
   Otherwise the mobile layout will be messed up




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org