Skip to main content
Version: 0.1

Services structure

Zookeeper is used here as a service discovery. The current watch fetches all services to the distributed nodes on each change - we should monitor the zookeeper performance and make sure it doesn't get overwhelmed overtime.

The zookeeper structure of a service:

NameTypeDescription
HoststringThe hostname or IP address of the gRPC server.
PortnumberThe port number on which the gRPC server listens.
RoutesRecord<string, RouteDetails>A mapping of route names to their respective details.

The RouteDetails structure:

NameTypeDescription
serviceNamestringThe fully qualified name of the gRPC service.
protoZnodestringThe path to the protocol buffer definition in zookeeper (optional).
internalbooleanIndicates if the route is using a service defined by the library (optional).
loadOptionsobjectConfiguration options for loading the gRPC proto file (optional).

Note: Either protoZnode or internal will be defined, but not both - the proto file and load options for internal services are predefined.

Example

get /hera-grpc/services/service*

/hera-grpc/services/service*
{
"host": "192.168.1.38",
"port": 50051,
"routes": {
"/slechtaj-1/dev~service_route/chat": {
"serviceName": "hera.chat.v1.ChatRoom",
"protoZnode": "/proto/buffer0000003732",
"loadOptions": {
"keepCase": true,
"longs": "String",
"enums": "String",
"defaults": true,
"oneofs": true
}
},
"/slechtaj-1/dev~service_route/poi": {
"serviceName": "RouteGuide",
"protoZnode": "/proto/buffer0000003733",
"loadOptions": {
"keepCase": true,
"longs": "String",
"enums": "String",
"defaults": true,
"oneofs": true
}
},
"/slechtaj-1/dev~service_route/file_share": {
"serviceName": "hera.fileshare.v1.FileShare",
"protoZnode": "/proto/buffer0000003734"
},
"/slechtaj-1/dev~service_route/json": {
"serviceName": "hera.internal.v1.JsonService",
"internal": true
},
"/slechtaj-1/dev~service_route/simple_proxy": {
"serviceName": "hera.proxy.v1.SimpleProxy",
"protoZnode": "/proto/buffer0000003735",
"loadOptions": {
"keepCase": true,
"longs": "String",
"enums": "String",
"defaults": true,
"oneofs": true
}
}
}
}