Spring Cloud重量路线谓词工厂

2024-01-04 17:26 更新

Weight Route Predicate Factory接受两个参数groupweight(一个int)。权重是按组计算的。

application.yml。 

spring:
  cloud:
    gateway:
      routes:
      - id: weight_high
        uri: https://weighthigh.org
        predicates:
        - Weight=group1, 8
      - id: weight_low
        uri: https://weightlow.org
        predicates:
        - Weight=group1, 2

此路由会将约80%的流量转发到https://weighthigh.org,并将约20%的流量转发到https://weighlow.org


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号