7.1. APIs - Core Services - Configuration and Registry

7.1.1. Architecture Reference

For a description of the architecture, see see Configuration and Registry

7.1.2. Introduction

The RESTful APIs are provided by Consul directly, and several communities supply Consul client libraries for different programming languages, including Go (official), Python, Java, PHP, Scala, Erlang/OTP, Ruby, Node.js, and C#.

For the client libraries of different languages, please refer to the list of this page:

7.1.3. Configuration Management

For the current API documentation, please refer to the official Consul web site:

7.1.4. Service Registry

For the current API documentation, please refer to the official Consul web site:

Service Registration

While each microservice is starting up, it should connect to Consul to register its endpoint information, including microservice ID, address, port number, and health checking method. After that, other microservices can locate its URL from Consul, and Consul has the ability to monitor its health status. The RESTful API of registration is described on the following Consul page:

Service Deregistration

Before microservices shut down, they have to deregister themsleves from Consul. The RESTful API of deregistration is described on the following Consul page:

Service Discovery

Service Discovery feature allows client micro services to query the endpoint information of a particular microservice by its microservice IDor list all available services registered in Consul. The RESTful API of querying service by microservice IDis described on the following Consul page:

The RESTful API of listing all available services is described on the following Consul page:

Health Checking

Health checking is a critical feature that prevents using services that are unhealthy. Consul provides a variety of methods to check the health of services, including Script + Interval, HTTP + Interval, TCP + Interval, Time to Live (TTL), and Docker + Interval. The detailed introduction and examples of each checking methods are described on the following Consul page:

The health checks should be established during service registration. Please see the paragraph on this page of Service Registration section.