Posted: 31 Jul 2018 9:38 EDT Last activity: 6 Aug 2018 15:09 EDT
Client Side Service Discovery
Services typically need to call one another. In a monolithic application, services invoke one another through language-level method or procedure calls. In a traditional distributed system deployment, services run at fixed, well known locations (hosts and ports) and so can easily call one another using HTTP/REST or some RPC mechanism. However, a modern microservice based application typically runs in a virtualized or containerized environments where the number of instances of a service and their locations changes dynamically.
How does the Pega client (typically a REST Connector in Pega) of a service - the API gateway or another service - discover the location of a service instance?
What will we need to build in the Pega environment to enable this?
When a Micro Service is running inside a container or a VM, the VM port on which the Service is running needs to be exposed or forwarded to the working local domain, it can be configured easily, for example while using docker.
Once this port forwarding is enabled you can telnet the local ip address and the VM port to assure connection.
Pega REST Connector should now be able to connect to the remote VM service.
As you mentioned "services run at fixed, well known locations (hosts and ports) and so can easily call one another using HTTP/REST or some RPC mechanism" - You just need to find the VM host and port. The process is still the same to invoke the rest service.