我正在通過documentation閱讀關於爲彈簧雲應用啓用ZuulProxy
的信息。春季雲應用中尤里卡ID和服務ID之間的區別?
它開始爲以下幾點:
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.
這裏服務ID被稱爲。我現在很困惑?以上application.yml
中的users
和users_service
是什麼。
據我的理解去,與尤里卡每個微服務應用程序寄存器提供了一個名稱爲bootstrap.yml
如下:例如,
spring:
application:
name: user
我的理解是,user
現在是Eureka ID以及服務ID。那麼users
和users_service
在上面是什麼意思呢?
我的問題是上面描述的application.yml中的'users'和'users_sevice'。他們在哪裏配置? –
'zuul.routes.users'是serviceId,除非有'serviceId'屬性。否則,它只是地圖上的一把鑰匙。 – spencergibb