随笔分类 - spring cloud gateway
摘要:Spring Cloud Gateway 限流 限流的目的是通过对并发访问/请求进行限速或者对一个时间窗口内的请求进行限速来保护系统,一旦达到限制速率则可由拒绝服务,就是定向到错误页或友好的展示页,排队或等待 Gateway内置过滤器工厂限流 Spring Cloud Gateway官方就提供了Re
阅读全文
摘要:Spring Cloud Gateway 权重路由 使用场景:需要多版本服务控制的时候,需要对服务进行权重路由,最常见的场景就是一个服务有两个版本V1,V2,在线上灰度的时候,需要忘光动态实时推送路由的权重信息,如95的流量到V1,5的流量到V2. spring: cloud: gateway: r
阅读全文
摘要:Spring Cloud Gateway 自定义Filter Spring Cloud Gateway 的Filter分为GatewayFilter和GlobalFilter两种,二者区别如下 GatewayFilter : 需要通过spring.cloud.routes.filters 配置在具体
阅读全文
摘要:Spring Cloud Gateway 内置Filter Spring Cloud Gateway中内置了很多过滤器,实现类有二十多个; 分类几类: AddRequestHeader 给请求加上一条header信息; spring: cloud: gateway: routes: - id: ad
阅读全文
摘要:Spring Cloud Gateway 断言 Spring Cloud Gateway提供了很多断言设置,当http请求进入Spring Cloud Gateway时,网关中的路由断言工厂会根基配置的路由规则,对http请求进行断言匹配,匹配成功的请求进行路由转发,失败的直接返回是错误信息。 以下
阅读全文
摘要:Spring Cloud Gateway 基本使用 maven依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</ar
阅读全文