Request microservice to another microservice

Viewed 57

I am migrating my project from ComputeEngine to AppEngine, in ComputeEngine I defined the port with which each service would work. So when communicating with each other, what I did was call them with a simple localhost: port and everything was happiness; until I have to do the same in AppEngine, it turns out that I cannot identify a kind of local url of each service that I have deployed.

I think that defining the public url (. .appspot.com) that is generated when deploying each service would be a bad idea due to the network traffic that would be generated.

1 Answers

With a dispatch.yaml, you can determine which service serves each 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
Related