2

Instances in my Google App engine Flexible Environment "compat" system communicate to each other communicate with each other with REST invocations. How can I port this to the new Flex Env?

The documentation says "You can no longer route traffic to specific instances, such as https://instance-dot-version-dot-service-dot-app-id.appspot.com" -- so how do I port this to non-compat Flex Env?

Joshua Fox
  • 18,704
  • 23
  • 87
  • 147

1 Answers1

4

This is really an App Engine anti-pattern - instances come up and go down all the time, so it's generally not advisable to try communicating between them like this. That having been said, there are two approaches here that can work.

  1. Use Google Cloud Pub/Sub. This is nice because you don't have to deal with the instance lifecycle issues. You put a job on a queue, and someone goes and picks it up.

  2. Use something like etcd with a ttl and IP addresses. You can have each instance report it's IP back to a central etcd instance on startup with a low TTL. Then you can query etcd to get a list of active instances and their IPs. Inside the network, using IP<->IP connectivity between the instances should be fine.

Best of luck!

Justin Beckwith
  • 7,686
  • 1
  • 33
  • 55