Soul 1.0.5 发布,基于 WebFlux 的 Reactive 网关

  

Soul关是一款基于webflux的Reactive网关,
* 提供了http,restful,websocket,dubbo springcloud的无缝集成
* 提供了限流,熔断,路由等等插件。
* soul的插件是热插拔,并且用户是可以自定义自由扩展。

Soul发布1.0.5版本

  • 新增websocket的支持与负载均衡
  • 新增restful风格的支持
  • 新增cors跨域支持
  • 修护get请求中文参数乱码问题

新增websocket支持

  • 首先我们来看ws访问soul网关路径 ws://localhost:8080/? module=ws&method=/bbex/websocket/buyAndSell&rpcType=websocket

    参数详解:
    1.localhost:8080 是soul启动的ip和端口。
    2.module(必填):值是你用来匹配selector的关键
    3.method (参数): 你的 websocket路径,同时也用做匹配rule
    4.rpcType :websocket 必填,且必须为websocket
    
  • 在divide插件配置匹配的选择器与规则,设置转发的websocket服务,设置负载策略等等。

cors跨域支持

  • 如果你使用soul,请参考org.dromara.soul.bootstrap.cors.CrossFilter
  • 完全支持用户自定义

restful风格的支持

请求soul网关的时候,在header头新增字段 pathVariable 值为用户自己传.
比如用户请求的真实路径为:http://localhost:8080/test/id/{}
你设置pathVariable值为3,那么soul网关就会封装成http://localhost:8080/test/id/3 发起代理调用.

get请求中文参数乱码问题

  • get请求如果字段带有中文参数,请先对extInfo字段先进行URLDecoder utf-8编码。再传递到soul网关。

Soul的具体使用文档:

  • 官网文档 :https://dromara.org/website/zh-cn/docs/soul/index.html
  • github地址: https://github.com/Dromara/soul
  • gitee地址: https://gitee.com/shuaiqiyu/soul
  • 欢迎大家star fork ,提供优秀的代码与建议。

猜你喜欢

转载自www.oschina.net/news/106216/soul-1-0-5-released