Git Product home page Git Product logo

fizz-gateway-node's Introduction

English | 简体中文

Version Documentation License: AGPL--3.0 Java CI with Maven

为了给大家提供更好的服务,社区版本仅供测试,不提供任何技术咨询,商业版本请添加企业微信获取商业支持。

FizzGate是什么?

An Aggregation API Gateway in Java . FizzGate 是一个基于 Java开发的微服务聚合网关,是拥有自主知识产权的应用网关国产化替代方案,能够实现热服务编排聚合、自动授权选择、线上服务脚本编码、在线测试、高性能路由、API审核管理、回调管理等目的,拥有强大的自定义插件系统可以自行扩展,并且提供友好的图形化配置界面,能够快速帮助企业进行API服务治理、减少中间层胶水代码以及降低编码投入、提高 API 服务的稳定性和安全性。

官方网站

https://www.fizzgate.com/

备用地址:https://www.fizzcrm.com/

演示环境(Demo)

https://demo.fizzgate.com/

备用站点:https://demo.fizzcrm.com/

账号/密码: FizzGate是一款付费软件,如有需求,可直接购买或者添加企业微信免费试用

健康检查地址:https://demo.fizzgate.com/admin/health (线上版本请限制admin路径的外网访问)

API地址:https://demo.fizzgate.com/proxy/[服务名]/[API_Path]

FizzGate的设计

FizzGate典型应用场景

产品特性

  • 应用管理:支持对接入的应用进行管理;
  • API管理:支持API定义后端服务的配置;
  • 分组管理:支持通过分组管理实现同一分组的API使用相关的配置;
  • 服务鉴权:通过插件可对服务进行应用访问权限、检验等链式的拦截策略;
  • 集群管理:FizzGate网关节点是无状态的,配置信息自动同步,支持节点水平拓展和多集群部署。
  • 安全授权:支持内置的key-auth, JWT, basic-auth授权方式,并且可以方便控制。
  • 服务编排:支持HTTP、Dubbo、gRPC、Soap协议热服务编排能力,支持前后端编码,支持JSON/XML输出,随时随地更新API。
  • 负载均衡:支持round-robin负载均衡。
  • 策略熔断:根据服务或者具体地址进行多种恢复策略熔断配置。
  • 多注册中心:支持从Eureka或Nacos注册中心进行服务发现。
  • 配置中心:支持接入apollo配置中心。
  • HTTP反向代理:隐藏真实后端服务,支持 Rest API反向代理。
  • 访问策略:支持不同策略访问不同的API、配置不同的鉴权等。
  • 黑白名单:支持配置通过绑定黑、白名单限制访问。
  • 自定义插件:强大的插件机制支持自由扩展。
  • 可扩展:简单易用的插件机制方便扩展功能。
  • 高性能:性能在众多网关之中表现优异。
  • 版本控制:支持操作的发布和多次回滚。
  • 管理后台:通过管理后台界面对网关集群进行各项配置。
  • 回调管理:支持回调的管理、订阅、重放、以及日志。
  • 多级限流:细颗粒度的限流方式包含服务限流,接口限流,APP_ID限流,IP限流。
  • 微服务文档:企业级管理开放微服务文档管理,系统集成更方便。
  • 公网专线:建立公网中受到完全保护的私有连接通道。

基准测试

我们将FizzGate与市面上主要的网关产品进行比较,使用相同的环境和条件,测试对象均为单个节点。Mock接口模拟20ms时延,报文大小约2K。

  • Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz * 4
  • Linux version 3.10.0-957.21.3.el7.x86_64
  • 8G RAM
分类 产品 600并发
QPS
600并发
90% Latency(ms)
1000并发
QPS
1000并发
90% Latency(ms)
后端服务 直接访问后端服务 23540 32.19 27325 52.09
流量网关 kong
v2.4.1
15662 50.87 17152 84.3
应用网关 fizz-gateway-node
v2.0.0
12206 65.76 12766 100.34
应用网关 spring-cloud-gateway
v2.2.9
11323 68.57 10472 127.59
应用网关 shenyu
v2.3.0
9284 92.98 9939 148.61

版本对照

  • fizz-gateway-node: 节点端

  • fizz-manager-professional:管理后台专业版(服务端)

  • fizz-admin-professional:管理后台专业版(前端)

fizz-gateway-node fizz-manager-professional fizz-admin-professional
v1.0.0 v1.0.0 v1.0.0
v1.1.0 v1.1.0 v1.1.0
v1.1.1 v1.1.1 v1.1.1
v1.2.0 v1.2.0 v1.2.0

从v1.3.0开始管理后台的前端和服务端合并成一个包

  • fizz-gateway-node: 节点端

  • fizz-manager-professional:管理后台

fizz-gateway-node fizz-manager-professional
v1.3.0 v1.3.0
... ...
v2.7.3 v2.7.3
v3.0.0 v3.0.0
v3.1.0 v3.1.0

请根据节点端的版本下载对应的管理后台版本

部署说明

详细部署教程>>>

安装依赖

安装以下依赖软件:

  • Redis v2.8或以上版本
  • MySQL v5.7或以上版本
  • Apollo配置中心 (可选)
  • Eureka v1.10.17或Nacos v2.0.4或以上版本(可选)

依赖的安装可参考详细部署教程

安装FizzGate

一、安装管理后台

下载 fizz-manager-professional 安装包

管理后台(fizz-manager-professional)

说明:

  1. 以下安装步骤出现的{version}表示所使用管理后台的版本号,例如1.3.0

安装方式一:二进制安装包

  1. 解压fizz-manager-professional-{version}.zip安装包
  2. 首次安装执行fizz-manager-professional-{version}-mysql.sql数据库脚本,从低版本升级至高版本选择执行update目录下对应升级脚本
  3. 修改application-prod.yml文件,将相关配置修改成部署环境的配置
  4. Linux启动 执行 chmod +x boot.sh 命令给boot.sh增加执行权限;执行 ./boot.sh start 命令启动服务,支持 start/stop/restart/status命令
  5. Windows启动 执行.\boot.cmd start 命令启动服务,支持 start/stop/restart/status命令

安装方式二(v2.0.0或以上版本):docker:

SQL脚本:解压fizz-manager-professional 安装包

首次安装执行fizz-manager-professional-{version}-mysql.sql数据库脚本,从低版本升级至高版本选择执行update目录下对应升级脚本(如有脚本则执行)

  1. 下载对应版本的镜像:docker pull fizzgate/fizz-manager-professional:{version}
  2. 通过环境变量方式修改redis配置、database配置(其它配置同理)并运行镜像
docker run --rm -d -p 8000:8000 \
-e "spring.redis.host={your redis host IP}" \
-e "spring.redis.port={your redis port}" \
-e "spring.redis.password={your redis password}" \
-e "spring.redis.database={your redis database}" \
-e "spring.datasource.url=jdbc:mysql://{your MySQL database host IP}:3306/fizz_manager?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true" \
-e "spring.datasource.username={your MySQL database username}" \
-e "spring.datasource.password={your MySQL database password}" \
fizzgate/fizz-manager-professional:{version}

或通过映射目录方式使用外部配置文件和输出日志到宿主机, 配置文件可从安装包里获取,在宿主机创建fizz-manager-professional/config和fizz-manager-professional/logs目录,把application-prod.yml配置文件放置config下,在fizz-manager-professional目录下运行镜像

cd fizz-manager-professional
docker run --rm -d -p 8000:8000 \
-v $PWD/config:/opt/fizz-manager-professional/config \
-v $PWD/logs:/opt/fizz-manager-professional/logs fizzgate/fizz-manager-professional:{version}

服务启动后访问 http://{部署机器IP地址}:8000/#/login,使用超级管理员账户admin密码Aa123!登录

二、安装fizz-gateway-node节点端

说明:

  1. 支持配置中心:apollo、nacos,支持注册中心:eureka、nacos,详细配置方法查看application.yml文件。
  2. 如果使用apollo配置中心,可把application.yml文件内容迁到配置中心(apollo上应用名为:fizz-gateway);如果不使用apollo可去掉下面启动命令里的apollo参数。
  3. 以下安装步骤出现的{version}表示所使用网关的版本号,例如1.3.0

安装方式一:二进制安装包

  1. 下载fizz-gateway-node的二进制安装包,解压修改application.yml配置文件里配置中心、注册中心、redis(redis配置需与管理后台一致)的配置
  2. 根据需要修改boot.sh脚本的apollo连接,不使用apollo配置中心可跳过
  3. Linux启动 执行 ./boot.sh start 命令启动服务,支持 start/stop/restart/status命令
  4. Windows启动 执行.\boot.cmd start 命令启动服务,支持 start/stop/restart/status命令

安装方式二:源码安装:

  1. 本地clone仓库上的最新代码,修改application.yml配置文件里配置中心、注册中心、redis(redis配置需与管理后台一致)的配置
  2. 在项目根目录fizz-gateway-node下执行Maven命令mvn clean package install -DskipTests=true
  3. 在项目目录fizz-gateway-node/fizz-bootstrap下执行Maven命令mvn clean package -DskipTests=true
  4. 进入fizz-gateway-node/fizz-bootstrap/target/fizz-gateway-node目录,执行 ./boot.sh start 命令启动服务,支持 start/stop/restart/status命令

安装方式三(v2.0.0或以上版本):docker:

  1. 下载对应版本的镜像:docker pull fizzgate/fizz-gateway-node:{version}
  2. 通过环境变量方式修改redis配置(其它配置同理)并运行镜像
docker run --rm -d -p 8600:8600 \
-e "aggregate.redis.host={your redis host IP}" \
-e "aggregate.redis.port={your redis port}" \
-e "aggregate.redis.password={your redis password}" \
-e "aggregate.redis.database={your redis database}" \
fizzgate/fizz-gateway-node:{version}

或通过映射目录方式使用外部配置文件和输出日志到宿主机, 配置文件可从安装包或源码里获取,在宿主机创建fizz-gateway-node/config和fizz-gateway-node/logs目录,把application.yml和log4j2-spring.xml配置文件放置config下,在fizz-gateway-node目录下运行镜像

cd fizz-gateway-node
docker run --rm -d -p 8600:8600 \
-v $PWD/config:/opt/fizz-gateway-node/config \
-v $PWD/logs:/opt/fizz-gateway-node/logs fizzgate/fizz-gateway-node:{version}

最后访问网关,地址形式为:http://127.0.0.1:8600/[服务名]/[API_Path]

相关文章

服务器减少50%,研发效率提高86%,我们的管理型网关FizzGate自研之路

简单易用的微服务聚合网关首选:FizzGate安装教程

大厂推荐使用的网关解密:FizzGate管理后台使用教程

架构师效率快的终极原因:FizzGate网关之服务编排

高阶架构师支招:FizzGate的插件开发

高阶程序员必备技能:FizzGate网关的二次开发

FizzGate网关入门教程-安装

FizzGate网关入门教程-路由初体验

FizzGate网关入门教程-权限校验

FizzGate网关入门教程-快速聚合多接口,提高页面数据的加载速度

FizzGate网关入门教程-服务编排,祭出终结BFF层的大杀器

企业级微服务API网关FizzGate-常用插件介绍

企业级微服务API网关FizzGate-如何自定义插件

企业级微服务API网关FizzGate-服务编排内置函数

FizzGate企业级微服务API网关进阶系列教程-服务编排处理列表数据(上)-展开与合并

FizzGate企业级微服务API网关进阶系列教程-服务编排处理列表数据(中)-数据提取与数据关联

FizzGate企业级微服务API网关进阶系列教程-服务编排处理列表数据(下)-字段重命名&字段移除

授权说明

  1. 网关核心项目fizz-gateway-node节点端本以GNU v3的方式进行的开放,任何商业使用都需要经过我们授权。

  2. 管理后台项目(fizz-manager-professional)作为商业版本仅开放二进制包 免费下载,而商业项目请注明公司名称联系我们([email protected])进行授权,了解商业授权规则请点击商业授权规则

  3. 在选择FizzGate之前,我们强烈建议您先试用一下我们的DEMO站点,试用我们的产品,并且思考与自身的业务结合,并且考虑产品推行落地方式,在查阅我们的官网价格(https://www.fizzgate.com) 之后再进一步与我们联系。

系统截图

homepage

aggr1

aggr2

route

plugin

appid

breaker

flowcontrol

doc

fizz-gateway-node's People

Contributors

dxfeng10 avatar frank0417 avatar hongqiaowei avatar linwaiwai avatar zhong-jie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fizz-gateway-node's Issues

Support custom the "proxy" field of the access url for gateway

网关访问地址格式为: http://{fizz网关ip:port}/proxy/{前端服务名}/{前端API路径}

I`m looking for a new gateway to replace our old gateway.
The new gateway should be compitable with the route rule of old gateway, but the format of the access url for fizz that is too fixed. It have to use "proxy" field in the url, and do not support config or do not use the field.

Compotent upgrade

May be Apollo and euraka can be upgraded to nacos be better, euraka's open source code gradually abandoned maintenance

Need backend service group

when using service orchestration, users should input http://ip:port/xxxxx (backend service), such as

  1. default env
  2. test env
  3. production env

what we want to input :

  1. default group
  2. test group
  3. ....

group means several backend ip:port with rotation and health check

Support sidecar traffic limit and ACL 服务治理需求应用场景(ACL、流控、RT/QPS统计等)

  1. 我们目前有这样普遍紧急一个场景,需要 acl与流控, 项目A-client 注册到nacos 调用 项目B-server 注册到nacos, A与B都是内部业务系统服务,可以理解 两个微服务;

  2. 有一大部分业务场景(如金融业务场景) api 很敏感,需要权限控制只允许指定的业务客户端可以访问;

最后希望 :服务网关在服务治理方面也有它的发挥作用的地方

部署问题

按照部署教程部署之后, 访问 http://ip:8000/fizz-manager/ (我的ip, 我部署在阿里云主机上, 使用的公网ip)
会出现以下错误, 咨询一下如何解决

code 404
success false
data {}
msg "No handler found for GET /fizz-manager/"

网关无法支持接口返回为数组类型

通过编排,县调用A接口,后调用B接口,
B接口的返回为 JsonArray类型的,配置通配符 * -> step2.request1.response.body 的时候,返回为空。
样例的配置json如下:

{
  "debug": true,
  "method": "POST",
  "validateResponse": {
    "headers": {},
    "fixedBody": {
      "msgCode": "404"
    },
    "fixedHeaders": {},
    "body": {
      "errorMsg": "string validateMsg"
    },
    "script": {}
  },
  "paramsDef": {
    "type": "object",
    "properties": {
      "password": {
        "type": "string",
        "title": "mima"
      },
      "username": {
        "type": "string",
        "title": "yonghu"
      }
    },
    "required": [
      "username"
    ]
  },
  "dataMapping": {
    "response": {
      "headers": {},
      "fixedBody": {},
      "fixedHeaders": {},
      "body": {
        "*": "string step2.request1.response.body"
      },
      "script": {}
    }
  },
  "type": "REQUEST",
  "version": 19,
  "path": "/proxytest/test/userserv/api/user/systeminfos",
  "langDef": {
    "langMapping": {
      "zh": "zh"
    },
    "langParam": ""
  },
  "headersDef": {
    "type": "object",
    "properties": {},
    "required": []
  },
  "stepConfigs": [
    {
      "stop": false,
      "dataMapping": {},
      "name": "step1",
      "requests": [
        {
          "method": "POST",
          "dataMapping": {
            "request": {
              "headers": {},
              "fixedParams": {},
              "fixedBody": {},
              "fixedHeaders": {},
              "body": {
                "*": "string input.request.body"
              },
              "params": {
                "*": "string input.request.params"
              },
              "script": {}
            },
            "response": {
              "headers": {},
              "fixedBody": {},
              "fixedHeaders": {},
              "body": {
                "*": "string step1.request1.response.body"
              },
              "script": {}
            }
          },
          "testUrl": "http://userserver:20100/userserv/oauth/token",
          "type": "REQUEST",
          "url": "http://userserver:20100/userserv/oauth/token",
          "timeout": "3000",
          "conditionFlag": false,
          "devUrl": "http://userserver:20100/userserv/oauth/token",
          "condition": {},
          "prodUrl": "http://userserver:20100/userserv/oauth/token",
          "name": "request1",
          "preUrl": "http://userserver:20100/userserv/oauth/token",
          "fallback": {
            "mode": "stop"
          }
        }
      ]
    },
    {
      "stop": false,
      "dataMapping": {},
      "name": "step2",
      "requests": [
        {
          "method": "GET",
          "dataMapping": {
            "request": {
              "headers": {
                "Authorization": {
                  "source": "function dyFunc(paramsJsonStr) {\n  var context = JSON.parse(paramsJsonStr)['context'];\n  var data = common.getStepRespBody(context, 'step1', 'request1', '');\n  var token = data['access_token'];\n  return \"bearer \" + token;\n}\n",
                  "aggregate_config_script_id": 2,
                  "type": "javascript"
                }
              },
              "fixedParams": {},
              "fixedHeaders": {},
              "params": {},
              "script": {}
            },
            "response": {
              "headers": {},
              "fixedBody": {},
              "fixedHeaders": {},
              "body": {
                "*": "string step2.request1.response.body"
              },
              "script": {}
            }
          },
          "testUrl": "http://userserver:20100/userserv/api/user/systeminfos",
          "type": "REQUEST",
          "url": "http://userserver:20100/userserv/api/user/systeminfos",
          "timeout": "3000",
          "conditionFlag": false,
          "devUrl": "http://userserver:20100/userserv/api/user/systeminfos",
          "condition": {},
          "prodUrl": "http://userserver:20100/userserv/api/user/systeminfos",
          "name": "request1",
          "preUrl": "http://userserver:20100/userserv/api/user/systeminfos",
          "fallback": {
            "mode": "stop"
          }
        }
      ]
    }
  ],
  "name": "queryuserInfo",
  "bodyDef": {
    "type": "object",
    "properties": {},
    "required": []
  },
  "id": "d9a7ce93-5cc4-43ea-9227-0cedc3d20b28",
  "scriptValidate": {}
}

add the top five services panel

add the top five slowest services panel
add the top five most frequently called services panel
add the top five services with the most errors panel

Who is using Fizz Gateway?(欢迎使用 Fizz Gateway 的个人和公司在此留言)

Who is using Fizz Gateway?

Sincerely thank everyone who constantly keeps on using and supporting Fizz Gateway. We will try our best to make Fizz Gateway better and make the community and ecology more prosperous.

The original intention of this issue

  • We’d like to listen to the community to make Fizz better.
  • We want to attract more partners to contribute to Fizz.
  • Learn more about the practical use scenarios of Fizz to facilitate the next step of planning.

What we expect from you

Please submit a comment in this issue to include the following information:

your company, school or organization.
your city and country.
your contact info: weibo, email, wechat (at least one).
for what business scenario do you use Fizz.

You can refer to the following sample answer:

* Organization: Fizz Gateway
* Location: GuangZhou, China
* Contact: [email protected]
* Purpose: as a API gateway to deal with east-west traffic between microservices.

Thanks again for your participation! Your support is the motivation for us to move forward.
Fizz Gateway community

谁在使用 Fizz Gateway?

感谢正在使用和关注 Fizz Gateway 的开发者,我们会持续投入,让 Fizz Gateway 项目和社区更加繁荣。

这个 issue 的出发点

  • 聆听社区的声音,让 Fizz Gateway 解决实际的问题
  • 吸引更多的开发者参与和贡献
  • 更多的了解 Fizz Gateway 的实际使用场景,以便后续版本的计划

我们期待您能提供

在此提交一条评论, 评论内容包括:

您所在公司、学校或组织
您所在的城市、国家
您的联系方式: 微博、邮箱、微信 (至少一个)
您将 Fizz Gateway 用于哪些业务场景

可以参考下面的示例:

组织: Fizz Gateway
地点:**广州
联系方式: [email protected]
使用场景:作为应用网关处理授权方面的问题

多谢您的支持!
Fizz Gateway 社区

Support custom appid/sign header name

To be compatible with the old system, such as old api gateway which using "app-id" or "signature" as header name, a secondary custom configurable appid/sign header name is required

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.