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

栏目: 编程语言 · 发布时间: 6年前

内容简介:Soul关是一款基于webflux的Reactive网关,* 提供了http,restful,websocket,dubbo springcloud的无缝集成* 提供了限流,熔断,路由等等插件。

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跨域支持

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 ,提供优秀的代码与建议。

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

查看所有标签

猜你喜欢:

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

Machine Learning

Machine Learning

Kevin Murphy / The MIT Press / 2012-9-18 / USD 90.00

Today's Web-enabled deluge of electronic data calls for automated methods of data analysis. Machine learning provides these, developing methods that can automatically detect patterns in data and then ......一起来看看 《Machine Learning》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器