Apache ShenYu(incubating) 发布 2.4.1

栏目: 软件资讯 · 发布时间: 4年前

内容简介:Apache ShenYu(Incubating) 2.4.1 正式发布 新功能 Admin管理后台开始支持PostgreSQL。 支持插件的动态加载。 新增Websocket插件。 新增请求参数加解密插件。 新增返回参数加解密插件。 支持 dubbo的灰度发布。 ...

Apache ShenYu(Incubating) 2.4.1 正式发布

新功能

  • Admin管理后台开始支持PostgreSQL。
  • 支持插件的动态加载。
  • 新增Websocket插件。
  • 新增请求参数加解密插件。
  • 新增返回参数加解密插件。
  • 支持 dubbo的灰度发布。
  • 支持 springCloud灰度发布。
  • 支持自定义crossFilter配置。
  • Sign插件支持自定义动态签名算法。
  • 支持 JDK8~JDK15

优化项

  • 优化 admin管理后台 SQL 语句初始化。
  • 优化 admin管理后台 分页查询逻辑。
  • 优化dubbo异步回调的问题。
  • 优化客户端注册逻辑。
  • 优化全局异常处理。
  • 优化Dubbo参数转换出来。

删除项

  • 删除lombok依赖
  • 删除mapstruct依赖

Bug fix

  • 解决 JwtPlugin, 关于JsonSyntaxException的问题。
  • 解决 resilience4jPlugin 配置初始化丢失的问题。
  • 解决 motanPlugin, 配置初始化丢失的问题。
  • 解决健康检查死锁的问题。
  • 解决客户端注册失败,重试的问题。
  • 解决Nacos使用默认分组的问题。
  • 解决 docker 镜像启动失败的问题。
  • 解决Gson转换null对象,空指针问题。
  • 解决 ContextPath错误配置的问题。
  • 解决客户端注册失败的问题。
  • 解决元数据写入失败的问题。
  • 解决 responsePlugin排序的问题。
  • 解决monitor插件未初始化Metrics的问题。

配置项的更改

具体详解请查看 : https://shenyu.apache.org/zh/docs/next/user-guide/property-config/gateway-property-config

shenyu:
#  httpclient:
#    strategy: webClient
#    connectTimeout: 45000
#    readTimeout: 3000
#    writeTimeout: 3000
#    wiretap: false
#    pool:
#      type: ELASTIC
#      name: proxy
#      maxConnections: 16
#      acquireTimeout: 45000
#    proxy:
#      host:
#      port:
#      username:
#      password:
#      nonProxyHostsPattern:
#    ssl:
#      useInsecureTrustManager: false
#      trustedX509Certificates:
#      handshakeTimeout:
#      closeNotifyFlushTimeout:
#      closeNotifyReadTimeout:
#      defaultConfigurationType:
  sync:
    websocket:
      urls: ws://localhost:9095/websocket
#    zookeeper:
#      url: localhost:2181
#      sessionTimeout: 5000
#      connectionTimeout: 2000
#    http:
#      url: http://localhost:9095
#    nacos:
#      url: localhost:8848
#      namespace: 1c10d748-af86-43b9-8265-75f487d20c6c
#      username:
#      password:
#      acm:
#        enabled: false
#        endpoint: acm.aliyun.com
#        namespace:
#        accessKey:
#        secretKey:
#    etcd:
#      url: http://localhost:2379
#    consul:
#      url: http://localhost:8500
#      waitTime: 1000
#      watchDelay: 1000
  cross:
    enabled: true
    allowedHeaders:
    allowedMethods: "*"
    allowedOrigin: "*"
    allowedExpose: "*"
    maxAge: "18000"
    allowCredentials: true
  switchConfig:
    local: true
  file:
    enabled: true
    maxSize : 10
  exclude:
    enabled: false
    paths:
      - /favicon.ico
  extPlugin:
    path:
    enabled: true
    threads: 1
    scheduleTime: 300
    scheduleDelay: 30
  scheduler:
    enabled: false
    type: fixed
    threads: 16
  upstreamCheck:
    enabled: false
    timeout: 3000
    healthyThreshold: 1
    unhealthyThreshold: 1
    interval: 5000
    printEnabled: true
    printInterval: 60000

Webscoket插件使用

Apache ShenYu 网关通过Websocket插件实现了对websocket代理的支持。

环境准备

需要在基础配置->插件管理中,把websocket 插件设置为开启。

在网关的 pom.xml 文件中引入websocket插件的相关依赖:

  <!--if you use http proxy start this-->
<dependency>
  <groupId>org.apache.shenyu</groupId>
  <artifactId>shenyu-spring-boot-starter-plugin-websocket</artifactId>
  <version>${project.version}</version>
</dependency>

请求方式

使用 Apache ShenYu 代理websocket的时候,只需要使用ws协议开头,后面路径为真实Websocket路径:

ws://localhost:9195/xxx

CryptorRequest 插件使用

cryptorRequest 插件是通过 fieldNames 去匹配 requestBody 里面的参数进行 解密 处理,替换当前 requestBody 内容。防互联网黑产,恶意获取数据。提高数据安全性。

插件使用

具体使用请参考 : https://shenyu.apache.org/zh/docs/next/plugin-center/authority-and-certification/cryptor-request-plugin/

  • shenyu-admin --> 基础配置 --> 插件管理 --> cryptor_request 设置为开启。

  • 在网关的 pom.xml 文件中添加 cryptorRequest 的支持。

<!-- apache shenyu Cryptor Request plugin start-->
<dependency>
  <groupId>org.apache.shenyu</groupId>
  <artifactId>shenyu-spring-boot-starter-plugin-cryptor</artifactId>
  <version>${project.version}</version>
</dependency>
<!-- apache shenyu Cryptor Request plugin end-->

CryptorResponse 插件使用

CryptorResponse 插件是通过 fieldNames 去匹配 responseBody 里面的参数进行 加密 处理,替换当前 fieldNames 对应内容。防互联网黑产,恶意获取数据。提高数据安全性。

插件使用

具体使用请参考 : https://shenyu.apache.org/zh/docs/next/plugin-center/authority-and-certification/cryptor-response-plugin

  • shenyu-admin --> 基础配置 --> 插件管理 --> cryptor_response 设置为开启

  • 在网关的 pom.xml 文件中添加 cryptorResponse 的支持。

<!-- apache shenyu Cryptor Response plugin start-->
<dependency>
  <groupId>org.apache.shenyu</groupId>
  <artifactId>shenyu-spring-boot-starter-plugin-cryptor</artifactId>
  <version>${project.version}</version>
</dependency>
<!-- apache shenyu Cryptor Response plugin end-->

插件动态加载

  • 当用户自定义扩展插件时候,可以使用此功能。扩展 ShenyuPlugin, PluginDataHandler, 不用成为 spring bean。只需要构建出扩展项目的jar包即可。

  • 使用以下配置:

shenyu:
  extPlugin:
    path:  //加载扩展插件jar包路径
    enabled: true //是否开启
    threads: 1  //加载插件线程数量
    scheduleTime: 300 //间隔时间(单位:秒)
    scheduleDelay: 30 //网关启动后延迟多久加载(单位:秒)

插件加载路径详解

  • 此路径是为存放扩展插件jar包的目录。

  • 可以使用 -Dplugin-ext=xxxx 指定,也可以使用 shenyu.extPlugin.path配置文件指定,如果都没配置,默认会加载网关启动路径下的 ext-lib目录。

  • 优先级 :-Dplugin-ext=xxxx > shenyu.extPlugin.path > ext-lib(default)

灰度发布

  • dubbo灰度发布请查看:

https://shenyu.apache.org/zh/docs/next/plugin-center/proxy/dubbo-plugin

  • springCloud灰度发布请查看:

https://shenyu.apache.org/zh/docs/next/plugin-center/proxy/spring-cloud-plugin

下个版本规划

  • GRPC,Tars,Sofa,Motan灰度发布的支持

  • MQTT协议的支持。

  • 其他插件的增强。

  • 新增Agent模块,提供网关Tracing的功能

关于Apache ShenYu

高性能,多协议,易扩展,响应式的API网关。于2021年5月进入Apache基金会进行孵化。

官网地址:https://shenyu.apache.org

Gitee地址 : https://gitee.com/Apache-ShenYu/incubator-shenyu
Github地址:https://github.com/apache/incubator-shenyu


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Design Accessible Web Sites

Design Accessible Web Sites

Jeremy Sydik / Pragmatic Bookshelf / 2007-11-05 / USD 34.95

It's not a one-browser web anymore. You need to reach audiences that use cell phones, PDAs, game consoles, or other "alternative" browsers, as well as users with disabilities. Legal requirements for a......一起来看看 《Design Accessible Web Sites》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

SHA 加密
SHA 加密

SHA 加密工具