Communication between Java services given IP address

27 views
Skip to first unread message

Luca Lupo

unread,
Jul 27, 2020, 8:22:24 AM7/27/20
to Google App Engine
Hi There,

I have 2 services: service1 and service2 both deployed using docker on Google cloud. service1 contains a table where it maps all instances of service2 and when needed will send message (REST request) to a specific instance of service2. 

Everything works if I use the full URL address that Google cloud provide for the service but I want to send the message to a specific instance (by using the instance ip address). The use case is the following: I have one instance of service1 that sends messages to instances of service2 to tell which data to load. Each instance of service2 might need to load different data. All instances of service2 ping regularly service1 to communicate their own IP addresses and statuses, so that service1 knows which one is available and which not.

However, it doesn't look like the REST api gets hit on any instance of service2 when service1 uses service2 instance IP address.

Any hint on how to achieve this?

Thanks!

George (Cloud Platform Support)

unread,
Jul 27, 2020, 8:59:46 AM7/27/20
to Google App Engine
Hello Luca, 

You may consider an address in the form of: https://VERSION_ID-dot-SERVICE_ID-dot-PROJECT_ID.REGION_ID.r.appspot.com    as detailed on the "Communicating Between Your Services" documentation page. You may profit from reading Microservices Architecture on Google App Engine as well. 

This discussion group is oriented more towards general opinions, trends, and issues of general nature touching the app engine. For coding and program architecture, as well as organizing inter-service communication, you may be better served in dedicated forums such as stackoverflow, where experienced programmers are within reach and ready to help.
Reply all
Reply to author
Forward
0 new messages