|
@@ -14,24 +14,24 @@ spring:
|
|
|
#配置路由,可以配置多组
|
|
#配置路由,可以配置多组
|
|
|
routes:
|
|
routes:
|
|
|
#配置路由的id,需要全局唯一,查询数据使用该路由
|
|
#配置路由的id,需要全局唯一,查询数据使用该路由
|
|
|
- - id: member10001
|
|
|
|
|
- #路由转发的URI,最终转发的URL = URI + PATH
|
|
|
|
|
- #uri: http://localhost:10001
|
|
|
|
|
- #使用负载均衡
|
|
|
|
|
- uri: lb://member-service-provider
|
|
|
|
|
- #配置路由的断言,满足条件时才进行路由
|
|
|
|
|
- predicates:
|
|
|
|
|
- #路径断言
|
|
|
|
|
- - Path=/member-gateway/member
|
|
|
|
|
- #方法断言
|
|
|
|
|
- - Method=GET
|
|
|
|
|
- #后置时间断言,时间格式为ZonedDateTime
|
|
|
|
|
- #- After=2025-09-10T19:01:03.749+08:00[Asia/Shanghai]
|
|
|
|
|
- #前置时间断言,时间格式为ZonedDateTime
|
|
|
|
|
- - Before=2025-09-11T19:01:03.749+08:00[Asia/Shanghai]
|
|
|
|
|
- filters:
|
|
|
|
|
- #重写路径,将请求路径中的member-gateway替换为member-provider,使用到正则表达式的命名捕获分组,语法格式:(?<捕获分组名称>pattern),引用捕获分组:$\{捕获分组名称}
|
|
|
|
|
- - RewritePath=/member-gateway/(?<segment>.*), /member-provider/$\{segment}
|
|
|
|
|
|
|
+# - id: member10001
|
|
|
|
|
+# #路由转发的URI,最终转发的URL = URI + PATH
|
|
|
|
|
+# #uri: http://localhost:10001
|
|
|
|
|
+# #使用负载均衡
|
|
|
|
|
+# uri: lb://member-service-provider
|
|
|
|
|
+# #配置路由的断言,满足条件时才进行路由
|
|
|
|
|
+# predicates:
|
|
|
|
|
+# #路径断言
|
|
|
|
|
+# - Path=/member-gateway/member
|
|
|
|
|
+# #方法断言
|
|
|
|
|
+# - Method=GET
|
|
|
|
|
+# #后置时间断言,时间格式为ZonedDateTime
|
|
|
|
|
+# #- After=2025-09-10T19:01:03.749+08:00[Asia/Shanghai]
|
|
|
|
|
+# #前置时间断言,时间格式为ZonedDateTime
|
|
|
|
|
+# - Before=2025-09-11T19:01:03.749+08:00[Asia/Shanghai]
|
|
|
|
|
+# filters:
|
|
|
|
|
+# #重写路径,将请求路径中的member-gateway替换为member-provider,使用到正则表达式的命名捕获分组,语法格式:(?<捕获分组名称>pattern),引用捕获分组:$\{捕获分组名称}
|
|
|
|
|
+# - RewritePath=/member-gateway/(?<segment>.*), /member-provider/$\{segment}
|
|
|
#第二组路由,新增数据使用该路由
|
|
#第二组路由,新增数据使用该路由
|
|
|
- id: member10002
|
|
- id: member10002
|
|
|
uri: http://localhost:10002
|
|
uri: http://localhost:10002
|