【发布时间】:2015-08-27 00:13:19
【问题描述】:
我正在阅读有关为 Spring Cloud 应用程序启用 ZuulProxy 的 documentation。
开头如下:
By convention, a service with the Eureka ID "users", will receive requests from the proxy located at /users
然后在文档中,它如下所示
To get more fine-grained control over a route you can specify the path and the serviceId independently:
application.yml
zuul:
routes:
users:
path: /myusers/**
serviceId: users_service
This means that http calls to "/myusers" get forwarded to the "users_service" service. The route has to have a "path" which can be specified as an ant-style pattern, so "/myusers/*" only matches one level, but "/myusers/**" matches hierarchically.
这里引用了 serviceID。我现在很困惑?以上application.yml中的users和users_service是什么。
据我了解,每个向 Eureka 注册的微服务应用都在bootstrap.yml 中提供如下名称:例如,
spring:
application:
name: user
我的理解是 user 现在是 Eureka ID 以及服务 ID。那么上面的users和users_service是什么意思呢?
【问题讨论】:
标签: spring spring-boot spring-cloud