Microservice architectures involve a number of smaller microservices interacting with each other. Adding to this, there can be multiple instances of each microservice. Maintaining the external service connections and configurations manually would be difficult as new instances of microservices are dynamically created and destroyed. Name servers provide features of service registration and service discovery. Name servers allow microservices to register themselves and also discover the URLs to other microservices they want to interact with.
In the previous example, we added the following configuration to application.properties
in the service consumer microservice:
random-proxy.ribbon.listOfServers= http://localhost:8080,http://localhost:8081
This configuration represents all instances of Microservice A. Take a look at these situations:
- A new instance of Microservice A is created
- An existing instance of Microservice A is no longer...