Service-Center(SC) is a service registry that allows services to register their instance information and to discover providers of a given service. SC uses etcd to store all the information of micro-service and its instances. Below is the diagram stating the working principles and flow of SC.
Here we assume that micro-services are written using java-chassis sdk. So when micro-service boots up then java-chassis sdk does the following list of tasks.
Once the bootup is successful then the consumer can communicate with providers flawlessly, below is the diagram illustrating the communication between provider and consumer.
Provider instance regularly sends heartbeat signal every 30 seconds to SC, if SC does not recieve the heartbeat for particular instance then the information in etcd expires and the provider instance information is removed.
Consumer watches the information of provider instances from SC and if there is any change then the cache is updated.
When Consumer needs to communicate to Provider then consumer reads endpoints of the provider instances from cache and do loadbalancing to communicate to Provider.
Note: This document is in beta stage, feel free to contribute to this document.