![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring cloud gateway
y&m
这个作者很懒,什么都没留下…
展开
-
Gateway网关使用不规范,同事加班泪两行~
Spring cloud gateway是替代zuul的网关产品,基于Spring 5、Spring boot 2.0以上、Reactor, 提供任意的路由匹配和断言、过滤功能。笔者公司之前有系统也使用了Spring cloud gateway做为后台应用访问的网关,采用的版本信息为:组件 版本 其他 spring boot 2.1.7.RELEASE spring cloud Greenwich.SR2 spring cloud gateway转载 2021-07-14 14:05:42 · 305 阅读 · 0 评论 -
Gateway 请求链路
转载 2021-06-21 10:35:33 · 292 阅读 · 0 评论 -
Gateway 解析 route
Gatewy入口对象 DispatcherHandlerAbstractHandlerMapping 的 getHandlerRoutePredicateHandlerMapping 的 getHandlerInternalRoutePredicateHandlerMapping 的 lookupRoute该方法即为route 寻址方法原创 2021-06-21 10:10:49 · 391 阅读 · 0 评论 -
Gateway Filter Chain 一次请求调用可能涉及的filter 图谱
原创 2021-06-21 09:29:24 · 136 阅读 · 0 评论 -
Sentinel规则校验(基于Gateway网关)
请求到达gateway网关后,sentinel校验基于SentinelGatewayFilter实现。Sentinel验证流程中params的获取尤为重要。文章简单记录了sentinel限流校验中重要的几个方法,具体不展开讲解了,如需帮助,请私聊。...原创 2021-04-20 11:14:57 · 327 阅读 · 0 评论 -
Sentinel Dashboard限流规则保存
sentinel在限流规则配置方面提供了可视化页面 sentinel dashboard,源码可从github下载,请自行搜索,此处不提供下载链接。规则持久化后首先触发GatewayFlowRuleController(源码似乎没有,请参考普通规则改造)的/new.json(或)请求,方法会调用publishRules()将本次编辑规则组装后通过远程调用请求gateway/updateRules更新远程服务内存中限流规则,该接口由远程服务UpdateGatewayRuleCommandHandler提供。原创 2021-04-20 10:32:51 · 422 阅读 · 1 评论 -
Sentinel匹配的Client IP策略(基于Gateway网关)
Sentinel匹配的Client IP策略GatewayParamParser对象中parseClientIp()private String parseClientIp(GatewayParamFlowItem item, T request) { String clientIp = this.requestItemParser.getRemoteAddress(request); String pattern = item.getPattern();原创 2021-04-20 09:32:55 · 4168 阅读 · 0 评论 -
Spring cloud gateway 设置context-path服务路由404排查
一、背景 最近做网关重构,技术选型为spring cloud gateway,采用consul作为配置中心和注册中心,秉承不重启原则,网关内部实现动态路由机制,采用定时任务定时更新网关路由信息。二、服务信息 微服务网关:spring-cloud-gateway 微服务:order-service、user-service三、问题描述 因为网关服务集成了knife4j,因此可以通过访问http://网关ip:port/doc.html,即可访问所有在同一个...原创 2020-06-12 17:33:41 · 9052 阅读 · 6 评论