[英]What if there are 'N' numbers of microservices then do we have to configure them all manually in Zuul Api Gateway?
假設我們有 zuul api 網關,並且有 n 個沒有用於微服務的 co,在這種情況下,我們如何路由到所有微服務? 我們必須在api網關的屬性文件中手動編寫它們的配置嗎?
`例如
zuul:
prefix: /api
routes:
defects-service:
path: /defects-service/**
serviceId: defects-service`
我們是否必須在application.properties文件中為所有微服務編寫這個?
如果你同時使用Eureka(發現服務)和 Zuul,你不需要手動給出 Zuul 中的所有路由。 相反, Zuul 將掃描 eureka 注冊表並獲取所有已注冊的應用程序
並確保您在 zuul 服務器中設置了這兩個屬性
eureka.client.registerWithEureka=true
eureka.client.fetchRegistry=true
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.