企业级微服务API网关Fizz,都有哪些常用插件可用?

2026-05-22 11:210阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计663个文字,预计阅读时间需要3分钟。

企业级微服务API网关Fizz,都有哪些常用插件可用?

前言:社区贡献的插件在 https://github.com/orgs/wehotel/repositories?type=all 下,一般以 fizz-plugin-* 或 fizz-*-plugin 命名,下面介绍一些常用的插件。

数据解码插件:https://github.com/wehotel/fizz-plugin-da

前言

社区贡献的插件在 github.com/orgs/wehotel/repositories?type=all 下,一般以 fizz-plugin-* 或 fizz-*-plugin 命名,下面介绍一些常用的插件。

数据掩码插件

github.com/wehotel/fizz-plugin-data-mask

用例:

若网关代理的后端接口响应 json 数据 {"mobile":"13710241024"},然后需要对手机号作掩码处理,则可为接口的路由配置插件:

配置后,请求接口时带 sourceType 请求头,其值为 ch1,收到响应为 {"mobile":"137xxxxxx24"}。

请求头插件

github.com/wehotel/fizz-plugin-header-request

用例:

为路由配置插件:

如此配置后,路由的后端接口收到的请求头中,将会有 hdr2=val2。

响应头插件

github.com/wehotel/fizz-plugin-header-response

用法同请求头插件。

阅读全文

本文共计663个文字,预计阅读时间需要3分钟。

企业级微服务API网关Fizz,都有哪些常用插件可用?

前言:社区贡献的插件在 https://github.com/orgs/wehotel/repositories?type=all 下,一般以 fizz-plugin-* 或 fizz-*-plugin 命名,下面介绍一些常用的插件。

数据解码插件:https://github.com/wehotel/fizz-plugin-da

前言

社区贡献的插件在 github.com/orgs/wehotel/repositories?type=all 下,一般以 fizz-plugin-* 或 fizz-*-plugin 命名,下面介绍一些常用的插件。

数据掩码插件

github.com/wehotel/fizz-plugin-data-mask

用例:

若网关代理的后端接口响应 json 数据 {"mobile":"13710241024"},然后需要对手机号作掩码处理,则可为接口的路由配置插件:

配置后,请求接口时带 sourceType 请求头,其值为 ch1,收到响应为 {"mobile":"137xxxxxx24"}。

请求头插件

github.com/wehotel/fizz-plugin-header-request

用例:

为路由配置插件:

如此配置后,路由的后端接口收到的请求头中,将会有 hdr2=val2。

响应头插件

github.com/wehotel/fizz-plugin-header-response

用法同请求头插件。

阅读全文