Link to communicate multiple applications as web services in a form
Otavio Santana
Given four applications into a single project that will work as microservices:
"https://{default}/conferences":
id: conference
type: upstream
upstream: "conference:http"
"https://{default}/sessions":
id: session
type: upstream
upstream: "session:http"
"https://{default}/speakers":
id: speaker
type: upstream
upstream: "speaker:http"
How can I make HTTP request to each other?
E.g:
Into conference application, how can I do a request into a speaker? Such as HTTP GET http://somehost/speakers
0
Comments
To have applications talk to each other add the relationship to the application that wants to initiate the connection. For example, to have the
conferenceapplication in the example above talk to thespeakersapplication, add the following to theconferenceinstance’s.platform.app.yamlfile:Then you can consult the
PLATFORM_RELATIONSHIPSenvironment variable for the domain name to use to send messages to that application. Omit thespeakerapplication fromroutes.yamlentirely.That is preferable to exposing each application on its own public URL just so that it can be accessed from another application.
Note that circular relationships are not supported, so you cannot have two applications that refer to each other in their
relationshipsblocks. Only the “sending” side of the connection needs to have a relationship defined.Please sign in to leave a comment.