Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route的相关问题 #3

Open
Maybrittnelson opened this issue Mar 1, 2019 · 0 comments
Open

route的相关问题 #3

Maybrittnelson opened this issue Mar 1, 2019 · 0 comments

Comments

@Maybrittnelson
Copy link
Owner

Maybrittnelson commented Mar 1, 2019

route

  • 请求进来,匹配每一个route,至于先匹配哪个route,由order决定。

Path

  • 定义多个Path一致的route
    • 谁先执行?order参数决定,值越小越先执行
    • 如果先执行的route,配置不正确(例如uri设置不正确),无法正常返回。会发生什么?执行下一个route的规则
  • PathRoutePredicate中的属性
    • matchOptionalTrailingSeparator的概念,是否忽略匹配尾斜杆(/lo, /lo/)。默认为true,自动忽略。
    • 可以配置多个路径
    • 如何stripprefix?StripPrefixGatewayFilterFactory
  • 如果最后路由的,
    • 网关默认返回{"timestamp":"2019-03-01T03:15:09.133+0000","path":"/a/b/user/find/all","status":404,"error":"Not Found","message":null}%

uri

  • 如果uri不正确,默认返回{"message":"Not Found"}

predicate

  • route的predicate默认关系是
  • 所有的predicate都会执行,不会一个失败了,就不执行?而是全部执行。

Predicate => AsyncPredicate

执行对应route 的predicate:r.getPredicate().test(exchange)

  1. new Route(this.id, this.uri, this.order, predicate,this.gatewayFilters);
  2. toAsyncPredicate(apply(config))

filter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant