[英]Bad Request when sending a WebClient request from a microservice to another microservice
[英]Request microservice to another microservice
我正在將我的項目從 ComputeEngine 遷移到 AppEngine,在 ComputeEngine 中我定義了每個服務可以使用的端口。 所以在互相交流的時候,我所做的就是用一個簡單的localhost來稱呼他們:端口,一切都是幸福的; 直到我必須在 AppEngine 中做同樣的事情之前,事實證明我無法識別我部署的每個服務的一種本地 url。
我認為,由於會產生網絡流量,定義在部署每個服務時生成的公共 url (. .appspot.com) 是一個壞主意。
使用dispatch.yaml
,您可以確定哪個服務為每個 url 提供服務:
dispatch: # don't forget: gcloud app deploy dispatch.yaml after changes !!!
- url: "*/urls/that/need/more/RAM/" # note wildcard capability
service: service_1
- url: "urls/that/need/more/speed/*" # note wildcard capability
service: service_2
- url: "service_1.app_name.appspot.com/*" # this should match cron calls to service_1 target
service: service_1
- url: "*/.*"
service: default
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.