Patterns
Service discovery is built into Kite with the kontrol application. The backend store for kontrol is not proprietary, but it uses a plugin architecture and supports etcd, consul, and so on.
If we look at our client application, we can see how this works in practice.
In line 19, we are calling the GetKites method and passing KontrolQuery as a parameter. The query contains the username, environment, and the name of the service we would like to reference.
The return type of this call is a slice of Kites. In our simple example, we are just getting a reference to the first item in the list. This process does mean that we have to implement load balancing and circuit breaking ourselves; it would have been nice if we could have had this feature ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access