Services
A service contains the following information:
- Identifier - unique identifier
- Name - Service name
- Hosts - List of hosts in which the service is hosted. Multiple hosts are allowed for load balancing
- Domain - Default domain
- Port - Default port
- MatchingURI - Unique uri to represent the service
- MatchingURIRegex - Regex to search by MatchingURI
- ToURI - Service base uri
- Protected - If service is protected with OAuth (Boolean)
- IsCachingActive - If caching is enabled (Boolean)
- IsActive - Is service running (Boolean)
- APIDocumentation - API Documentation location
- HealthcheckUrl - URL to call to check if service is running
- LastActiveTime - Last time the service was running (in milliseconds)
- ServiceManagementHost - Service management service host
- ServiceManagementPort - Service management service port
- ServiceManagementEndpoints - Service management service available endpoints
- RateLimit - Global rate limit (rps)
- RateLimitExpirationTime - Global rate limit expiration time (in minutes)
- IsReachable - If micro service is reachable from external requests
- GroupId - Group Id to which the micro service belongs. null if no group
- GroupVisibility - Group Visibility to external requests
- UseGroupAttributes - If the service must use group attributes (currently: visibility)
- ProtectedExclude - remove authentication from some endpoints
In order to get more information on ServiceManagement part, check here
In order to get more information on Rate Limiting part, check here
In order to get more information on Reachability, check here
Matching URI
The matching uri is used to call the correct service. Currently, it is supported complex URIs with more than one subroute.
Example:
/gapi/modules/service-discovery calls gapi service discovery component located at /service-discovery. Everything that goes after /service-discovery is considered a service endpoint.
With this configuration, when you call /gapi/modules/service-discovery/services it is called /service-discovery/services on the service host.
Hosts
Currently, gAPI has a simple load balancing.
In order to register multiple hosts for a service, you must add an entry with a new host to Hosts array.