routes:
- id:order_route(路由唯一 标识,路由到order)
uri:http://localhost:8020 #需要转发的地址
#断言规则(用于路由规则的匹配)
predicates:
-path=/order-serv/**
-path=lb://order-service # lb: 使用nacos中的本地负载均衡策略(一般用这个)
匹配到:http://localhost:8020/order-serv/order/add
#过滤器去掉第一次的路径
filters:
-StripPrefix=1
改成:http://localhost:8020/order/add
集成necos
gatway:

路由断言工厂:
作用:当请求gatway时,使用断言对请求进行匹配,如果匹配成功则路由转发,匹配失败则返回404;
类型:内置,自定义
过滤器工厂:
作用:通过过滤器工厂进行一些业务逻辑处理器,比如:添加剔除响应头,添加去除参数等
类型:(内置、自定义)局部过滤器、全局过滤器
Gatway跨域处理
Gatway整合sentinel实现网关限流

